vim /etc/mysql/mysql.conf.d/mysqld.cnf
将
bind-address = 127.0.0.1
改为
bind-address = 0.0.0.0
然后重启
/etc/init.d/mysql restart
mysql开启远程连接
原文:https://www.cnblogs.com/guanglun/p/12207234.html