三步解决 设置安全组: 设置防火墙: iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT 设置root用户连接host: 终端登录mysql,然后: use mysql; select user,host from user where user='root'; update user set host='%' where user='root';