1、linux远程机mysql安装上之后,需要将root用户对应的host改成%,目的是让所有的ip都能访问
# 首先登录上mysql
use mysql;
select user,host from user where user='root';
update user set host='%' where user='root';
2、linux远程机防火墙开放3306端口
iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT #允许3306数据库端口通过防火墙
重启防火墙
3、阿里云服务器安全组开放3306端口