远程链接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

 

posted @ 2015-07-26 13:51  l_u_l_u  阅读(200)  评论(0编辑  收藏  举报