当前位置:Gxlcms > 数据库问题 > 解决Host 'xxx' is not allowed to connect to this MySQL server

解决Host 'xxx' is not allowed to connect to this MySQL server

时间:2021-07-01 10:21:17 帮助过:18人阅读

问题描述: 本地主机连接到服务器上的mysql时报错:Host ‘xxx‘ is not allowed to connect to this MySQL server;

服务器配置;windows server;

分析: 这是mysql的访问权限问题

解决办法:

1.进入服务器,运行cmd进入dos界面;

2.输入命令:mysql -u root -p 输入密码;

3.命令:use mysql;

4.命令:grant all privileges on *.* to root@"xxx.xxx.xxx.xxx" identified by "密码";

("xxx.xxx.xxx.xxx"表示允许连接的主机ip,如果允许所有主机,使用"%"。 密码是允许主机连接时使用的密码)

(例如:grant all privileges on *.* to root@"%" identified by "123";)

5.查看mysql允许的主机: 命令:select user,password,host from user;

 

 

本人系新手上路,文章可能显得臃肿,写下来记录自己的成长历程。

水平有限,欢迎并感谢纠错指正

解决Host 'xxx' is not allowed to connect to this MySQL server

标签:select   ant   连接   问题   访问   password   解决办法   服务器   sel   

人气教程排行