Centos7系統下以RPM方式如何安裝mysql-5.7

檢查系統是否裝有mariadbhtml

rpm -qa | grep mariadbnode

卸載mariadbmysql

強制卸載mariadblinux

rpm -e --nodeps mariadb-libs-5.5.35-3.el7.x86_64sql

安裝mysqlspa

rpm -ivh mysql-community-common-5.7.12-1.el7.x86_64.rpm .net

rpm -ivh mysql-community-libs-5.7.12-1.el7.x86_64.rpm 3d

rpm -ivh mysql-community-client-5.7.12-1.el7.x86_64.rpm code

rpm -ivh mysql-community-server-5.7.12-1.el7.x86_64.rpm server

其中在安裝 mysql-community-server-5.7.12-1.el7.x86_64.rpm 時可能會由於系統沒有相應依賴文件而安裝失敗,以下

安裝perl:

yum install perl



yum install libaio

 

 

安裝完畢後啓動mysql:


查看初始密碼:service mysqld start

用初始密碼登陸grep 'temporary password' /var/log/mysqld.log


登錄後修改密碼:mysql -uroot -p
 ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';

 

參考:

http://www.jb51.net/LINUXjishu/401516.html

http://dev.mysql.com/doc/refman/5.7/en/linux-installation-rpm.html

相關文章
相關標籤/搜索