1.首先檢查下系統是否已經有mysql相關的安裝項node
rpm -qa|grep mysql
2.若是有,先刪除mysql
rpm -e --nodeps mysql-libs-5.1.73-3.el6_5.×86_64
3.接着,先安裝mysql服務端sql
rpm -ivh MySQL-server-5.6.24-1.el6.×86_64.rpm
4.獲取root用戶初始密碼bash
cat /root/.mysql_secret
5.啓動mysqlspa
service mysql start
6.安裝mysql客戶端code
rpm -ivh MySQL-client-5.6.24-1.el6.×86_64.rpm
7.用root用戶登陸server
mysql -uroot -p
8.修改密碼blog
SET PASSWORD=PASSWORD('123456');
9.進入mysql庫修改user表使其餘主機都能登陸訪問class
use mysql; update user set host='%' where host='localhost' and user='root';
10.刪除user表中其餘不必的數據並刷新登錄
delete from user where user='root' and host<>'%'; flush privileges;