远程连接ubuntu下MySQL

远程连接ubuntu下MySQL

vim /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

sudo /etc/init.d/mysql restart

猜你喜欢

转载自lizhuohuang.iteye.com/blog/1757504