vim /etc/mysql/my.cnf找到bind-address = 127.0.0.1
注释掉这行,如:#bind-address = 127.0.0.1
或者改为: bind-address = 0.0.0.0
允许任意IP访问;
重启 MySQL:sudo /etc/init.d/mysql restart
授权用户能进行远程连接
grant all privileges on *.* to root@"%" identified by "password" with grant option;
flush privileges;