Linux平臺(CentOS 6.5) RPM包方式安裝 Mysql 5.7
在 Mysql 官網下載 RPM 的 bundle 包並解壓。
[root@localhost mysql5.7]# tar xvf mysql-5.7.12-1.el6.x86_64.rpm-bundle.tar
單獨安裝 Server 包,報依賴關係的錯誤。
[root@T400-kelong software]# rpm -ivh mysql-community-server-5.7.10-1.el6.x86_64.rpm
warning: mysql-community-server-5.7.10-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
error: Failed dependencies:
mysql-community-client(x86-64) = 5.7.10-1.el6 is needed by mysql-community-server-5.7.10-1.el6.x86_64
mysql-community-common(x86-64) = 5.7.10-1.el6 is needed by mysql-community-server-5.7.10-1.el6.x86_64
將所需的包新增上,依然報錯,缺少另外一個包。
[root@T400-kelong software]# rpm -ivh mysql-community-server-5.7.10-1.el6.x86_64.rpm mysql-community-common-5.7.10-1.el6.x86_64.rpm mysql-community-client-5.7.10-1.el6.x86_64.rpm
warning: mysql-community-server-5.7.10-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
error: Failed dependencies:
mysql-community-libs(x86-64) = 5.7.10-1.el6 is needed by mysql-community-client-5.7.10-1.el6.x86_64
將所需的包新增上,繼續報錯,和系統自帶的 5.1 版本衝突。
[root@T400-kelong software]# rpm -ivh mysql-community-server-5.7.10-1.el6.x86_64.rpm mysql-community-common-5.7.10-1.el6.x86_64.rpm mysql-community-client-5.7.10-1.el6.x86_64.rpm mysql-community-libs-5.7.10-1.el6.x86_64.rpm
warning: mysql-community-server-5.7.10-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ########################################### [100%]
file /usr/share/mysql/czech/errmsg.sys from install of mysql-community-common-5.7.10-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-5.el6_6.x86_64
file /usr/share/mysql/danish/errmsg.sys from install of mysql-community-common-5.7.10-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-5.el6_6.x86_64
解除安裝掉報錯的mysql 5.1安裝包
[root@T400-kelong software]# yum remove mysql-libs-5.1.73-5.el6_6.x86_64
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Remove Process
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
--> Running transaction check
---> Package mysql-libs.x86_64 0:5.1.73-5.el6_6 will be erased
--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: perl-DBD-MySQL-4.013-3.el6.x86_64
--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: perl-DBD-MySQL-4.013-3.el6.x86_64
--> Running transaction check
---> Package perl-DBD-MySQL.x86_64 0:4.013-3.el6 will be erased
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================================
Removing:
mysql-libs x86_64 5.1.73-5.el6_6 @base 4.0 M
Removing for dependencies:
perl-DBD-MySQL x86_64 4.013-3.el6 @base 338 k
Transaction Summary
=============================================================================================================================================================
Remove 2 Package(s)
Installed size: 4.4 M
Is this ok [y/N]: y
安裝 RPM 包
[root@T400-kelong software]# rpm -ivh mysql-community-server-5.7.10-1.el6.x86_64.rpm mysql-community-common-5.7.10-1.el6.x86_64.rpm mysql-community-client-5.7.10-1.el6.x86_64.rpm mysql-community-libs-5.7.10-1.el6.x86_64.rpm
warning: mysql-community-server-5.7.10-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ########################################### [100%]
1:mysql-community-common ########################################### [ 25%]
2:mysql-community-libs ########################################### [ 50%]
3:mysql-community-client ########################################### [ 75%]
4:mysql-community-server ########################################### [100%]
啟動資料庫。
[root@T400-kelong sbin]# service mysqld start
初始化 MySQL 資料庫: [確定]
正在啟動 mysqld: [確定]
[root@T400-kelong sbin]# service mysqld status
mysqld (pid 4782) 正在執行...
[root@T400-kelong sbin]# ps -ef|grep mysql
root 4586 1 0 21:11 pts/1 00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --pid-file=/var/run/mysqld/mysqld.pid --basedir=/usr --user=mysql
mysql 4782 4586 2 21:11 pts/1 00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/lib/mysql/mysql.sock
root 4847 3857 0 21:11 pts/1 00:00:00 grep mysql
使用臨時密碼登入到 ROOT 使用者,更改 ROOT 密碼。
grep 'temporary password' /var/log/mysql/mysqld.log
[root@T400-kelong sbin]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.10
Copyright (c) 2000, 2015, 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.
[root@localhost mysql5.7]# tar xvf mysql-5.7.12-1.el6.x86_64.rpm-bundle.tar
[root@T400-kelong software]# rpm -ivh mysql-community-server-5.7.10-1.el6.x86_64.rpm
warning: mysql-community-server-5.7.10-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
error: Failed dependencies:
mysql-community-client(x86-64) = 5.7.10-1.el6 is needed by mysql-community-server-5.7.10-1.el6.x86_64
mysql-community-common(x86-64) = 5.7.10-1.el6 is needed by mysql-community-server-5.7.10-1.el6.x86_64
將所需的包新增上,依然報錯,缺少另外一個包。
[root@T400-kelong software]# rpm -ivh mysql-community-server-5.7.10-1.el6.x86_64.rpm mysql-community-common-5.7.10-1.el6.x86_64.rpm mysql-community-client-5.7.10-1.el6.x86_64.rpm
warning: mysql-community-server-5.7.10-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
error: Failed dependencies:
mysql-community-libs(x86-64) = 5.7.10-1.el6 is needed by mysql-community-client-5.7.10-1.el6.x86_64
[root@T400-kelong software]# rpm -ivh mysql-community-server-5.7.10-1.el6.x86_64.rpm mysql-community-common-5.7.10-1.el6.x86_64.rpm mysql-community-client-5.7.10-1.el6.x86_64.rpm mysql-community-libs-5.7.10-1.el6.x86_64.rpm
warning: mysql-community-server-5.7.10-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ########################################### [100%]
file /usr/share/mysql/czech/errmsg.sys from install of mysql-community-common-5.7.10-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-5.el6_6.x86_64
file /usr/share/mysql/danish/errmsg.sys from install of mysql-community-common-5.7.10-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-5.el6_6.x86_64
[root@T400-kelong software]# yum remove mysql-libs-5.1.73-5.el6_6.x86_64
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Remove Process
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
--> Running transaction check
---> Package mysql-libs.x86_64 0:5.1.73-5.el6_6 will be erased
--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: perl-DBD-MySQL-4.013-3.el6.x86_64
--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: perl-DBD-MySQL-4.013-3.el6.x86_64
--> Running transaction check
---> Package perl-DBD-MySQL.x86_64 0:4.013-3.el6 will be erased
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================================
Removing:
mysql-libs x86_64 5.1.73-5.el6_6 @base 4.0 M
Removing for dependencies:
perl-DBD-MySQL x86_64 4.013-3.el6 @base 338 k
Transaction Summary
=============================================================================================================================================================
Remove 2 Package(s)
Installed size: 4.4 M
Is this ok [y/N]: y
[root@T400-kelong software]# rpm -ivh mysql-community-server-5.7.10-1.el6.x86_64.rpm mysql-community-common-5.7.10-1.el6.x86_64.rpm mysql-community-client-5.7.10-1.el6.x86_64.rpm mysql-community-libs-5.7.10-1.el6.x86_64.rpm
warning: mysql-community-server-5.7.10-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ########################################### [100%]
1:mysql-community-common ########################################### [ 25%]
2:mysql-community-libs ########################################### [ 50%]
3:mysql-community-client ########################################### [ 75%]
4:mysql-community-server ########################################### [100%]
[root@T400-kelong sbin]# service mysqld start
初始化 MySQL 資料庫: [確定]
正在啟動 mysqld: [確定]
[root@T400-kelong sbin]# service mysqld status
mysqld (pid 4782) 正在執行...
root 4586 1 0 21:11 pts/1 00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --pid-file=/var/run/mysqld/mysqld.pid --basedir=/usr --user=mysql
mysql 4782 4586 2 21:11 pts/1 00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/lib/mysql/mysql.sock
root 4847 3857 0 21:11 pts/1 00:00:00 grep mysql
使用臨時密碼登入到 ROOT 使用者,更改 ROOT 密碼。
grep 'temporary password' /var/log/mysql/mysqld.log
[root@T400-kelong sbin]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.10
Copyright (c) 2000, 2015, 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> alter user 'root'@'localhost' identified by 'System#2013';
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26506993/viewspace-1994769/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- CentOS 6.5/6.6 安裝mysql 5.7CentOSMySql
- Percona MySQL 5.7 Linux通用二進位制包安裝(CentOS 6.5)MySqlLinuxCentOS
- 基於Linux的MySQL5.7RPM包安裝LinuxMySql
- Centos 7 製作MySQL 5.7 RPM包CentOSMySql
- CentOS下使用rpm包安裝MySQLCentOSMySql
- centos以RPM包方式安裝redis的方法CentOSRedis
- centos7下rpm方式安裝mysqlCentOSMySql
- Mysql 5.7在OL 6上以RPM包安裝MySql
- 在Linux(Redhat/CentOS)下安裝MySQL之yum(rpm)線上安裝方式LinuxRedhatCentOSMySql
- mysql 5.6 for linux (rpm包安裝)MySqlLinux
- CentOS 6 下RPM方式安裝MySQL5.6CentOSMySql
- 在Linux(Redhat/CentOS)下安裝MySQL之yum(rpm)離線安裝方式LinuxRedhatCentOSMySql
- Percona MySQL 5.6 RPM包方式安裝流程MySql
- Linux下用rpm方式安裝MySQLLinuxMySql
- CentOS 7 - 安裝MySQL 5.7CentOSMySql
- CentOS 7 安裝 MySQL 5.7CentOSMySql
- centos安裝mysql5.7CentOSMySql
- CentOS安裝MySQL的兩種方式——RPM和YUMCentOSMySql
- CentOS7.4使用rpm包安裝mysql5.7.17CentOSMySql
- CentOS 6.5下安裝MySQL 5.5CentOSMySql
- centos(linux): rpm -V 驗證rpm包安裝程式的安全CentOSLinux
- Linux下Centos7以rpm方式離線安裝MySQL5.7教程以及部分報錯解決方案LinuxCentOSMySql
- centos6.5環境使用RPM包離線安裝MariaDB 10.0.20CentOS
- Linux CentOS6.5下編譯安裝MySQL 5.6LinuxCentOS編譯MySql
- 在CentOS7上安裝MySQL5.7-YUM源方式CentOSMySql
- CentOS 6.5下快速安裝MySQL 5.7.17CentOSMySql
- mysql安裝------RPM包安裝及解除安裝MySql
- rpm包方式安裝Percona serverServer
- CentOS 6.5安裝Oracle 11.2.0.4------CentOS 6.5安裝CentOSOracle
- MySQL 5.7.22 rpm 安裝方式MySql
- CentOS7 64位安裝mysql5.7(linux)CentOSMySqlLinux
- 新手小白Linux(Centos6.5)部署java web專案(mysql5.7安裝及相關操作)LinuxCentOSJavaWebMySql
- CentOS7.3 安裝 MySQL5.7CentOSMySql
- CentOS7 安裝mysql5.7CentOSMySql
- mysql5.7安裝_centos7MySqlCentOS
- linux jdk rpm包安裝LinuxJDK
- Centos系統通過tar.gz包安裝Mysql5.7CentOSMySql
- MySQL之——RPM方式安裝MySQL5.6MySql