设置Ubuntu Mysql可以远程链接

1:修改my.cnf配置文件

$sudo vim /etc/mysql/my.cnf

修改为:

bind-address = 0.0.0.0

2:进行授权操作

mysql> grant all privileges on *.* to 'root'@'%' with grant option;
Query OK, 0 rows affected (0.00 sec)

mysql>

---允许所有以root用户登陆的所有主机(%)进行链接访问,在这里没有设置密码;

也可以设置密码:

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

 

posted @ 2014-12-09 09:58  yshy  阅读(202)  评论(0编辑  收藏  举报