1.http://mirrors.sohu.com/mysql/MySQL-5.6/下載 到/home
MySQL-client-5.6.40-1.el6.x86_64.rpm
MySQL-devel-5.6.40-1.el6.x86_64.rpm
MySQL-shared-5.6.40-1.el6.x86_64.rpm
MySQL-server-5.6.40-1.el6.x86_64.rpm
2.# rpm -qa|grep mysql
mysql-libs-5.1.73-7.el6.x86_64 #<=卸載自帶的mysql依賴包
# rpm -e mysql-libs-5.1.73-7.el6.x86_64 --nodeps
3.# rmp -ivh MySQL-client-5.6.40-1.el6.x86_64.rpm #<=安裝4個rpm包
# rmp -ivh MySQL-devel-5.6.40-1.el6.x86_64.rpm
# rmp -ivh MySQL-shared-5.6.40-1.el6.x86_64.rpm
# rmp -ivh MySQL-server-5.6.40-1.el6.x86_64.rpm
4. 安裝完 最後一個rpm 提示如下
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.
5.# shutdown -r now #<=重啓
6.# service mysql status #<=mysql自動啓動了
7.# mysql -u root -p
password: 此處輸入 '/root/.mysql_secret'. 中的初始隨機密碼 進入mysql
8.mysql>SET PASSWORD = PASSWORD('123456');
9.完成安裝
10.開放互聯網環境訪問接入 update user set host = '%' where user = 'root'
11.如果是服務器請添加開放3306 安全策略配置