mysql只能连接localhost解决

grant all privileges on *.* to 'root'@'%' identified by 'root';
flush privileges;

原文地址:https://www.cnblogs.com/yeyuchangfeng/p/4653772.html