解决客户端连接mysql出现 xxx.xxx.xxx.xxx is not allowed to connect to this MySQL server

2014-11-24 18:43:17 · 作者: · 浏览: 2

于是我采用新增加一个用户的方法,并赋予任意ip都可以远程连接的权限,



mysql新增用户


#mysql -uroot -proot


mysql> grant all privileges on *.* to 'test'@'%' identified by 'test' with grant option;


mysql> flush privileges;


此处'%'很重要,代表任意ip都可以远程连接,而默认的root用户只能“localhost” 所以才会报 “ is not allowed to connect to this MySQL server” 无法连接数据库


然后在远程连接一下,发现能连接了!


问题解决! mark 一下 ^_^