远程链接mysql error 2003

进入mysql

mysql>use mysql;
mysql>update user set host = '%' where user = 'root';
mysql>flush privileges;
mysql>select host, user from user;

修改/etc/mysql/my.cnf,

把bind-address = 127.0.0.1

改成bind-address = 0.0.0.0

root@ubuntu:~# vi /etc/mysql/my.cnf

# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address    = 127.0.0.1
bind-address    = 0.0.0.0

改完保存后, 重启mysql

 root@ubuntu:~# service mysql restart
原文地址:https://www.cnblogs.com/coolulu/p/4677558.html