Redhat Linux 安装MySQL安装手册

1 下载

下载地址:点击跳转
https://downloads.mysql.com/archives/community/
在这里插入图片描述
查看服务器Redhat操作系统版本:
[root@localhost etc]# cat redhat-release
Red Hat Enterprise Linux Server release 7.4 (Maipo)
注意:下载的数据库版本要对应上操作系统的版本。Redhat 7不能安装Redhat 5 对应的包。

2 上传服务器、解压并安装

MySQL-5.5.13-1.rhel5.x86_64.tar
[root@localhost mysqltar]# ls -l
总用量 169412
-rw-rw-r--. 1 rhel rhel 173475840 8月   4 10:09 MySQL-5.5.13-1.rhel5.x86_64.tar
[root@localhost mysqltar]# tar -xf MySQL-5.5.13-1.rhel5.x86_64.tar 
[root@localhost mysqltar]# ls -l
总用量 338828
-rw-rw-r--. 1 rhel rhel  173475840 8月   4 10:09 MySQL-5.5.13-1.rhel5.x86_64.tar
-rw-r--r--. 1 7161 wheel  18191523 5月  12 2011 MySQL-client-5.5.13-1.rhel5.x86_64.rpm
-rw-r--r--. 1 7161 wheel   3817189 5月  12 2011 MySQL-devel-5.5.13-1.rhel5.x86_64.rpm
-rw-r--r--. 1 7161 wheel  52613561 5月  12 2011 MySQL-embedded-5.5.13-1.rhel5.x86_64.rpm
-rw-r--r--. 1 7161 wheel  53626322 5月  12 2011 MySQL-server-5.5.13-1.rhel5.x86_64.rpm
-rw-r--r--. 1 7161 wheel   2059662 5月  12 2011 MySQL-shared-5.5.13-1.rhel5.x86_64.rpm
-rw-r--r--. 1 7161 wheel  43161486 5月  12 2011 MySQL-test-5.5.13-1.rhel5.x86_64.rpm

3 安装

依次安装

1.yum install MySQL-shared-5.6.51-1.el7.x86_64.rpm #安装mysql兼容包
2.yum install MySQL-shared-compat-5.6.51-1.el7.x86_64.rpm #共享库兼容包
3.yum install MySQL-server-5.6.51-1.el7.x86_64.rpm #安装mysql的服务器程序
4.yum install MySQL-client-5.6.51-1.el7.x86_64.rpm #安装mysql的客户端程序
5.yum install MySQL-devel-5.6.51-1.el7.x86_64.rpm #安装mysql的库和头文件

安装过程1:MySQL-shared-5.6.51-1.el7.x86_64.rpm

[root@localhost install_mysql]# yum install MySQL-shared-5.6.51-1.el7.x86_64.rpm
已加载插件:langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Bad id for repo: mirrors.aliyun.com_docker-ce_linux_centos_docker-ce.xn--repo()-mu8ig98h4l0hokj, byte = ( 60
正在检查 MySQL-shared-5.5.13-1.rhel5.x86_64.rpm: MySQL-shared-5.5.13-1.rhel5.x86_64
MySQL-shared-5.5.13-1.rhel5.x86_64.rpm 将被安装
正在解决依赖关系
--> 正在检查事务
---> 软件包 MySQL-shared.x86_64.0.5.5.13-1.rhel5 将被 安装
--> 解决依赖关系完成

依赖关系解决

==========================================================================================================
 Package             架构          版本                  源                                          大小
==========================================================================================================
正在安装:
 MySQL-shared        x86_64        5.5.13-1.rhel5        /MySQL-shared-5.5.13-1.rhel5.x86_64        6.7 M

事务概要
==========================================================================================================
安装  1 软件包

总计:6.7 M
安装大小:6.7 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
警告:RPM 数据库已被非 yum 程序修改。
  正在安装    : MySQL-shared-5.5.13-1.rhel5.x86_64                                                    1/1 
  验证中      : MySQL-shared-5.5.13-1.rhel5.x86_64                                                    1/1 

已安装:
  MySQL-shared.x86_64 0:5.5.13-1.rhel5        

安装过程2:MySQL-shared-compat-5.6.51-1.el7.x86_64.rpm

[root@localhost install_mysql]# yum install MySQL-shared-compat-5.6.51-1.el7.x86_64.rpm 
已加载插件:langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Bad id for repo: mirrors.aliyun.com_docker-ce_linux_centos_docker-ce.xn--repo()-mu8ig98h4l0hokj, byte = ( 60
正在检查 MySQL-shared-compat-5.6.51-1.el7.x86_64.rpm: MySQL-shared-compat-5.6.51-1.el7.x86_64
MySQL-shared-compat-5.6.51-1.el7.x86_64.rpm 将被安装
正在解决依赖关系
--> 正在检查事务
---> 软件包 MySQL-shared-compat.x86_64.0.5.6.51-1.el7 将被 舍弃
---> 软件包 mariadb-libs.x86_64.1.5.5.56-2.el7 将被 取代
--> 解决依赖关系完成

依赖关系解决

====================================================================================================
 Package                架构      版本            源                                           大小
====================================================================================================
正在安装:
 MySQL-shared-compat    x86_64    5.6.51-1.el7    /MySQL-shared-compat-5.6.51-1.el7.x86_64     11 M
      替换  mariadb-libs.x86_64 1:5.5.56-2.el7

事务概要
====================================================================================================
安装  1 软件包

总计:11 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : MySQL-shared-compat-5.6.51-1.el7.x86_64                                         1/2 
  正在删除    : 1:mariadb-libs-5.5.56-2.el7.x86_64                                              2/2 
警告:文件 /usr/share/mysql/ukrainian/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/ukrainian: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/swedish/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/swedish: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/spanish/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/spanish: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/slovak/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/slovak: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/serbian/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/serbian: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/russian/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/russian: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/romanian/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/romanian: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/portuguese/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/portuguese: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/polish/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/polish: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/norwegian/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/norwegian-ny/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/norwegian-ny: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/norwegian: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/korean/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/korean: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/japanese/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/japanese: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/italian/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/italian: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/hungarian/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/hungarian: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/greek/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/greek: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/german/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/german: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/french/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/french: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/estonian/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/estonian: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/english/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/english: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/dutch/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/dutch: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/danish/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/danish: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/czech/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/czech: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/swe7.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/macroman.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/macce.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/latin7.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/latin5.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/latin2.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/latin1.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/koi8u.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/koi8r.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/keybcs2.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/hp8.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/hebrew.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/greek.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/geostd8.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/dec8.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/cp866.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/cp852.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/cp850.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/cp1257.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/cp1256.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/cp1251.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/cp1250.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/ascii.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/armscii8.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/README: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/Index.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql: 移除失败: 没有那个文件或目录
  验证中      : MySQL-shared-compat-5.6.51-1.el7.x86_64                                         1/2 
  验证中      : 1:mariadb-libs-5.5.56-2.el7.x86_64                                              2/2 

已安装:
  MySQL-shared-compat.x86_64 0:5.6.51-1.el7                                                         

替代:
  mariadb-libs.x86_64 1:5.5.56-2.el7                                                                

完毕!

安装过程3:MySQL-server-5.6.51-1.el7.x86_64.rpm

root用户初始密码存放在’/root/.mysql_secret’.

[root@localhost install_mysql]# yum install MySQL-server-5.6.51-1.el7.x86_64.rpm 
已加载插件:langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Bad id for repo: mirrors.aliyun.com_docker-ce_linux_centos_docker-ce.xn--repo()-mu8ig98h4l0hokj, byte = ( 60
正在检查 MySQL-server-5.6.51-1.el7.x86_64.rpm: MySQL-server-5.6.51-1.el7.x86_64
MySQL-server-5.6.51-1.el7.x86_64.rpm 将被安装
正在解决依赖关系
--> 正在检查事务
---> 软件包 MySQL-server.x86_64.0.5.6.51-1.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

====================================================================================================
 Package            架构         版本                 源                                       大小
====================================================================================================
正在安装:
 MySQL-server       x86_64       5.6.51-1.el7         /MySQL-server-5.6.51-1.el7.x86_64       270 M

事务概要
====================================================================================================
安装  1 软件包

总计:270 M
安装大小:270 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : MySQL-server-5.6.51-1.el7.x86_64                                                1/1 
警告:用户mysql 不存在 - 使用root
警告:群组mysql 不存在 - 使用root
警告:用户mysql 不存在 - 使用root
警告:群组mysql 不存在 - 使用root
2023-08-04 15:03:42 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2023-08-04 15:03:42 0 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
2023-08-04 15:03:42 0 [Note] /usr/sbin/mysqld (mysqld 5.6.51) starting as process 113852 ...
2023-08-04 15:03:42 113852 [Note] InnoDB: Using atomics to ref count buffer pool pages
2023-08-04 15:03:42 113852 [Note] InnoDB: The InnoDB memory heap is disabled
2023-08-04 15:03:42 113852 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2023-08-04 15:03:42 113852 [Note] InnoDB: Memory barrier is not used
2023-08-04 15:03:42 113852 [Note] InnoDB: Compressed tables use zlib 1.2.11
2023-08-04 15:03:42 113852 [Note] InnoDB: Using Linux native AIO
2023-08-04 15:03:42 113852 [Note] InnoDB: Using CPU crc32 instructions
2023-08-04 15:03:42 113852 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2023-08-04 15:03:42 113852 [Note] InnoDB: Completed initialization of buffer pool
2023-08-04 15:03:42 113852 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2023-08-04 15:03:42 113852 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2023-08-04 15:03:42 113852 [Note] InnoDB: Database physically writes the file full: wait...
2023-08-04 15:03:42 113852 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2023-08-04 15:03:43 113852 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2023-08-04 15:03:43 113852 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2023-08-04 15:03:43 113852 [Warning] InnoDB: New log files created, LSN=45781
2023-08-04 15:03:43 113852 [Note] InnoDB: Doublewrite buffer not found: creating new
2023-08-04 15:03:43 113852 [Note] InnoDB: Doublewrite buffer created
2023-08-04 15:03:43 113852 [Note] InnoDB: 128 rollback segment(s) are active.
2023-08-04 15:03:43 113852 [Warning] InnoDB: Creating foreign key constraint system tables.
2023-08-04 15:03:43 113852 [Note] InnoDB: Foreign key constraint system tables created
2023-08-04 15:03:43 113852 [Note] InnoDB: Creating tablespace and datafile system tables.
2023-08-04 15:03:43 113852 [Note] InnoDB: Tablespace and datafile system tables created.
2023-08-04 15:03:43 113852 [Note] InnoDB: Waiting for purge to start
2023-08-04 15:03:43 113852 [Note] InnoDB: 5.6.51 started; log sequence number 0
2023-08-04 15:03:43 113852 [Note] RSA private key file not found: /var/lib/mysql//private_key.pem. Some authentication plugins will not work.
2023-08-04 15:03:43 113852 [Note] RSA public key file not found: /var/lib/mysql//public_key.pem. Some authentication plugins will not work.
2023-08-04 15:03:43 113852 [Note] Binlog end
2023-08-04 15:03:43 113852 [Note] InnoDB: FTS optimize thread exiting.
2023-08-04 15:03:43 113852 [Note] InnoDB: Starting shutdown...
2023-08-04 15:03:45 113852 [Note] InnoDB: Shutdown completed; log sequence number 1625977
A random root password has been set. You will find it in '/root/.mysql_secret'.


2023-08-04 15:03:45 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2023-08-04 15:03:45 0 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
2023-08-04 15:03:45 0 [Note] /usr/sbin/mysqld (mysqld 5.6.51) starting as process 113882 ...
2023-08-04 15:03:45 113882 [Note] InnoDB: Using atomics to ref count buffer pool pages
2023-08-04 15:03:45 113882 [Note] InnoDB: The InnoDB memory heap is disabled
2023-08-04 15:03:45 113882 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2023-08-04 15:03:45 113882 [Note] InnoDB: Memory barrier is not used
2023-08-04 15:03:45 113882 [Note] InnoDB: Compressed tables use zlib 1.2.11
2023-08-04 15:03:45 113882 [Note] InnoDB: Using Linux native AIO
2023-08-04 15:03:45 113882 [Note] InnoDB: Using CPU crc32 instructions
2023-08-04 15:03:45 113882 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2023-08-04 15:03:45 113882 [Note] InnoDB: Completed initialization of buffer pool
2023-08-04 15:03:45 113882 [Note] InnoDB: Highest supported file format is Barracuda.
2023-08-04 15:03:45 113882 [Note] InnoDB: 128 rollback segment(s) are active.
2023-08-04 15:03:45 113882 [Note] InnoDB: Waiting for purge to start
2023-08-04 15:03:45 113882 [Note] InnoDB: 5.6.51 started; log sequence number 1625977
2023-08-04 15:03:45 113882 [Note] RSA private key file not found: /var/lib/mysql//private_key.pem. Some authentication plugins will not work.
2023-08-04 15:03:45 113882 [Note] RSA public key file not found: /var/lib/mysql//public_key.pem. Some authentication plugins will not work.
2023-08-04 15:03:45 113882 [Note] Binlog end
2023-08-04 15:03:45 113882 [Note] InnoDB: FTS optimize thread exiting.
2023-08-04 15:03:45 113882 [Note] InnoDB: Starting shutdown...
2023-08-04 15:03:47 113882 [Note] InnoDB: Shutdown completed; log sequence number 1625987




A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !
You will find that password in '/root/.mysql_secret'.

You must change that password on your first connect,
no other statement but 'SET PASSWORD' will be accepted.
See the manual for the semantics of the 'password expired' flag.

Also, the account for the anonymous user has been removed.

In addition, you can run:

  /usr/bin/mysql_secure_installation

which will also give you the option of removing the test database.
This is strongly recommended for production servers.

See the manual for more instructions.

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

  http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

New default config file was created as /usr/my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings

  验证中      : MySQL-server-5.6.51-1.el7.x86_64                                                1/1 

已安装:
  MySQL-server.x86_64 0:5.6.51-1.el7                                                                

完毕!

安装过程4:MySQL-client-5.6.51-1.el7.x86_64.rpm

[root@localhost install_mysql]# yum install MySQL-client-5.6.51-1.el7.x86_64.rpm 
已加载插件:langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Bad id for repo: mirrors.aliyun.com_docker-ce_linux_centos_docker-ce.xn--repo()-mu8ig98h4l0hokj, byte = ( 60
正在检查 MySQL-client-5.6.51-1.el7.x86_64.rpm: MySQL-client-5.6.51-1.el7.x86_64
MySQL-client-5.6.51-1.el7.x86_64.rpm 将被安装
正在解决依赖关系
--> 正在检查事务
---> 软件包 MySQL-client.x86_64.0.5.6.51-1.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

=========================================================================================================================================================================================================
 Package                                     架构                                  版本                                           源                                                                大小
=========================================================================================================================================================================================================
正在安装:
 MySQL-client                                x86_64                                5.6.51-1.el7                                   /MySQL-client-5.6.51-1.el7.x86_64                                 82 M

事务概要
=========================================================================================================================================================================================================
安装  1 软件包

总计:82 M
安装大小:82 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : MySQL-client-5.6.51-1.el7.x86_64                                                                                                                                                     1/1 
  验证中      : MySQL-client-5.6.51-1.el7.x86_64                                                                                                                                                     1/1 

已安装:
  MySQL-client.x86_64 0:5.6.51-1.el7                                                                                                                                                                     

完毕!
[root@localhost install_mysql]# 

安装过程5:MySQL-devel-5.6.51-1.el7.x86_64.rpm

[root@localhost install_mysql]# yum install MySQL-devel-5.6.51-1.el7.x86_64.rpm 
已加载插件:langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Bad id for repo: mirrors.aliyun.com_docker-ce_linux_centos_docker-ce.xn--repo()-mu8ig98h4l0hokj, byte = ( 60
正在检查 MySQL-devel-5.6.51-1.el7.x86_64.rpm: MySQL-devel-5.6.51-1.el7.x86_64
MySQL-devel-5.6.51-1.el7.x86_64.rpm:不更新已安装的软件包。
错误:无须任何处理
[root@localhost install_mysql]# yum install MySQL-shared-compat-5.6.51-1.el7.x86_64.rpm 
已加载插件:langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Bad id for repo: mirrors.aliyun.com_docker-ce_linux_centos_docker-ce.xn--repo()-mu8ig98h4l0hokj, byte = ( 60
正在检查 MySQL-shared-compat-5.6.51-1.el7.x86_64.rpm: MySQL-shared-compat-5.6.51-1.el7.x86_64
MySQL-shared-compat-5.6.51-1.el7.x86_64.rpm 将被安装
正在解决依赖关系
--> 正在检查事务
---> 软件包 MySQL-shared-compat.x86_64.0.5.6.51-1.el7 将被 舍弃
---> 软件包 mariadb-libs.x86_64.1.5.5.56-2.el7 将被 取代
--> 解决依赖关系完成

依赖关系解决

====================================================================================================
 Package                架构      版本            源                                           大小
====================================================================================================
正在安装:
 MySQL-shared-compat    x86_64    5.6.51-1.el7    /MySQL-shared-compat-5.6.51-1.el7.x86_64     11 M
      替换  mariadb-libs.x86_64 1:5.5.56-2.el7

事务概要
====================================================================================================
安装  1 软件包

总计:11 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : MySQL-shared-compat-5.6.51-1.el7.x86_64                                         1/2 
  正在删除    : 1:mariadb-libs-5.5.56-2.el7.x86_64                                              2/2 
警告:文件 /usr/share/mysql/ukrainian/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/ukrainian: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/swedish/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/swedish: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/spanish/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/spanish: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/slovak/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/slovak: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/serbian/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/serbian: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/russian/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/russian: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/romanian/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/romanian: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/portuguese/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/portuguese: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/polish/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/polish: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/norwegian/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/norwegian-ny/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/norwegian-ny: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/norwegian: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/korean/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/korean: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/japanese/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/japanese: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/italian/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/italian: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/hungarian/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/hungarian: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/greek/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/greek: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/german/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/german: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/french/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/french: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/estonian/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/estonian: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/english/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/english: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/dutch/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/dutch: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/danish/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/danish: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/czech/errmsg.sys: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/czech: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/swe7.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/macroman.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/macce.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/latin7.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/latin5.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/latin2.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/latin1.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/koi8u.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/koi8r.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/keybcs2.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/hp8.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/hebrew.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/greek.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/geostd8.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/dec8.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/cp866.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/cp852.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/cp850.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/cp1257.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/cp1256.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/cp1251.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/cp1250.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/ascii.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/armscii8.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/README: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets/Index.xml: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql/charsets: 移除失败: 没有那个文件或目录
警告:文件 /usr/share/mysql: 移除失败: 没有那个文件或目录
  验证中      : MySQL-shared-compat-5.6.51-1.el7.x86_64                                         1/2 
  验证中      : 1:mariadb-libs-5.5.56-2.el7.x86_64                                              2/2 

已安装:
  MySQL-shared-compat.x86_64 0:5.6.51-1.el7                                                         

替代:
  mariadb-libs.x86_64 1:5.5.56-2.el7                                                                

完毕!

4 启动

启动前报错:ERROR 2002 (HY000)

该报错是MySQL未启动导致

[root@localhost etc]# mysql start
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[root@localhost ~]# ps -ef|grep mysql
root     120137  84527  0 17:12 pts/2    00:00:00 grep --color=auto mysql

启动即可正常连接

[root@localhost etc]# cd init.d/
[root@localhost init.d]# ls
functions  mysql  netconsole  network  README  rhnsd
[root@localhost init.d]# ./mysql start
Starting MySQL.. SUCCESS! 
[root@localhost init.d]# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 1
Server version: 5.6.51

Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

mysql> Ctrl-C -- exit!

2 rpm操作

安装命令:
# rpm -ivh MySQL-server-5.1.73-1.glibc23.i386.rpm
查看安装包:
# rpm -qa | grep -i  mysql
卸载命令:
# rpm -e mysql-libs-5.1.73.8.e16_8.i686 //普通删除模式
# rpm -e __nodeps mysql-libs-5.1.73.8.e16_8.i686 //强力删除模式,如果使用上面的指令删除时.提示有依赖,则可用该命令进行强力删除

3 yum操作

安装命令
# yum install MySQL-shared-5.5.13-1.rhel5.x86_64.rpm 
卸载命令
# yum remove mysql-libs-5.1.73.8.e16_8.i686 

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
THE END
分享
二维码
< <上一篇

)">
下一篇>>