sudo vi /etc/mysql/my.cnf

  找到bind-address = 127.0.0.1

  注释掉这行:#bind-address = 127.0.0.1

  或者改为: bind-address = 0.0.0.0 (允许任意IP访问)

  或者自己指定一个IP地址。

 

mysql -h localhost -uroot -p

  Grant all privileges on *.* to 'root'@'%' identified by 'password' with grant option;

  flush privileges;

 

sudo /etc/init.d/mysql restart

 

 

posted on 2014-03-25 10:54  英雄小强  阅读(449)  评论(0编辑  收藏  举报