网站首页 美食营养 游戏数码 手工爱好 生活家居 健康养生 运动户外 职场理财 情感交际 母婴教育 时尚美容

not allowed to connect to this MySQL server

时间:2024-10-11 18:51:26

1、在用Navicat配置远程连接Mysql数据库时遇到如下报错信息,这是由于Mysql配置了不支持远程连接引起的。

not allowed to connect to this MySQL server

2、在安装Mysql数据库的主机上登录root用户:mysql -u root -p

not allowed to connect to this MySQL server

3、依次执行如下命令:use mysq;select host 酆璁冻嘌from user where user='root';可以看到当前主机配置信息为localhost.

not allowed to connect to this MySQL server

4、执行update user set host = '%' where user ='root'将Host设置为通配符%。Host设置了“%”后便可以允许远程访问。

not allowed to connect to this MySQL servernot allowed to connect to this MySQL server

5、Host修改完成后记得执行flush privilegs使配置立即生效。

not allowed to connect to this MySQL server

6、完成以上操作后,再试尝试远程连接Mysql,报错信息消失。如果再次连接出现2059报错信息,可以参考以下经验解决。

not allowed to connect to this MySQL server
© 2025 五度知识库
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com