Apr 29, 2009
mysql远程连接小问题
在utuntu服务器上装mysql似乎很简单,就一行命令:
apt-get install mysql-server
然而当我想使用远程用户登录这个mysql服务器的时候,耗了老力气了。
思路:新建一个用户
GRANT ALL *.* TO aaa@% IDENTIFIED BY ‘bbb’ WIDTH GRANT OPTION;
用户建好了,远程试一下吧:
mysql -u -h -P -p…
链接报错。
脑子猛然一闪,忘了flush privileges了:)
flush privileges 顺利执行,try again
结果还是不成。难道是网络不通?
telnet host port
网络果真不通,为什么呢?
查看一下mysql的配置吧…..
在my.cnf找到了这么一行
bind-address = 127.0.0.1
难道他只针对本机开放?于是改成了线上服务ip.
try again: telnet host port
通了,
mysql -u -h -P -p也成了。
O ye!
thx
张久安
If you enjoyed this post, make sure you subscribe to my RSS feed!









No Comments, Comment or Ping
Reply to “mysql远程连接小问题”
You must be logged in to post a comment.