1.指定允许远程连接的用户
mysql -u root -p
mysql>use mysql;
mysql>update user set host = '%' where user = 'root';
mysql>flush privileges;
mysql>exit;
如果没有创建用户,执行grant all PRIVILEGES on 数据库名.* to 用户名@'%' identified by '密码'
2.iptables 里删除DROP 3306端口的规则
iptables -L -n --line-numbers
iptables -D INPUT 9