Host is not allowed to connect to this MySQL server 解决办法

message from server: “Host is not allowed to connect to this MySQL server ,问题的根本是localhost,说明只支持本地连接,不能远程登录。

1.登录mysql(注意:账号密码不包括,-u和-p)

mysql -uroot -proot

2.切换到mysql库:

use mysql;

3.查询root用户的host值:

select user,host from user;

如果host的值是localhost,说明只支持本地连接,不能远程登录。

4.更改host的值为%:

update user set host = '%' where user='root';

5.刷新权限:

flush privileges;

一般到这一步就可以远程登录了。

6.重启MySQL:

net stop mysql

net start mysql

7.即可外部连接mysql

批量修改文件名精灵 2024年最新版
批量修改文件名称、文件夹名称

免费使用 功能无限制

方便快捷,支持正则表达式、无需安装功能齐全、支持定制无广告、无插件,放心使用。

免费下载 百度网盘
本站中所有的计算器的计算结果仅供参考,本站对此结果的准确性不承担任何责任,实际数额以银行/保险公司/国家相关机构确认的结果为准。
在线客服QQ:543690914,备案号: 苏ICP备15037649号-33。东海县白塔埠镇佳诚电脑经营部版权所有。