Maison  >  Article  >  base de données  >  解决客户端连接mysql出现 xxx.xxx.xxx.xxx is not allowed to connect to

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

WBOY
WBOYoriginal
2016-06-07 17:18:09946parcourir

在CentOS上把mysql都配置好了,在Linux下登录mysql都没有问题,但是在Windows下用navicat远程连接连接msyql时报 is not allowed

在CentOS上把mysql都配置好了,在Linux下登录mysql都没有问题,但是在Windows下用navicat远程连接连接msyql时报 is not allowed to connect to this MySQL server ,上网一查,发现是没有远程连接的权限

于是我采用新增加一个用户的方法,,并赋予任意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 一下   ^_^

linux

Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn