裝mysql5.6使用了rpm-bundle.tar方法, 竟是沒成功, 總是提示分享庫的各種問題, 於是乎, 使用了這種方法(借鑑百度經驗, 度娘偉大)
用到的命令
rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
yum repolist enabled | grep "mysql.*-community.*"
yum -y install mysql-community-server
systemctl enable mysqld
mysql_secure_installation
安裝rpm包
[root@cn ~]# rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
查看當前可用的mysql安裝資源:
[root@cn ~]# yum repolist enabled | grep "mysql.*-community.*"
從上面的列表可以看出,mysql56-community/x86_64和MySQL 5.6 Community Server可以使用。
因此,我們就可以直接用yum方式安裝了MySQL5.6版本了。
安裝mysql5.6
[root@cn ~]# yum -y install mysql-community-server
(因爲我這裏安裝過了, 所以顯示這樣)
安裝成功後,將其加入開機啓動
[root@cn ~]# systemctl enable mysqld
啓動mysql服務進程
[root@cn ~]# systemctl start mysqld
配置mysql(設置密碼等)
[root@cn ~]# mysql_secure_installation
當前密碼:回車
Change the root password? [Y/n] Y [更改密碼]
Remove anonymous users? [Y/n] Y [刪除匿名用戶]
Disallow root login remotely? [Y/n] n [禁止root遠程登錄]
Remove test database and access to it? [Y/n] Y [刪除test數據庫]
Reload privilege tables now? [Y/n] y [刷新權限]
[root@cn ~]# mysql -u root -p
測試一下, 能否登陸, 成功
遠程登陸需開放端口3306(需要在雲服務器管理控制檯上處理)
到此爲止就結束了