1. MySql安裝教程
https://dev.mysql.com/doc/refman/5.7/en/linux-installation-yum-repo.html
默認情況下mysq的 root用戶是不能遠程連接的
2. 查看linux防火牆是否開放3306端口

3. 添加防火牆例外

4. 重啟防火牆

5. 創建遠程連接用戶並授權
mysql> select host,user,password from mysql.user;

創建用戶
create user test identified by '123456';

授權
grant all privileges on *.* to 'test'@'%'identified by '123456' with grant option; flush privileges;
修改用戶密碼
update mysql.user set password=password('新密碼') where User="test" and Host="localhost";
刪除用戶
delete from user where User='test' and Host='localhost';
