not allowed to connect to this MySQL server

本文主要介绍如何修复1130 - Host XXX is not allowed to connect to this MySQL server。

操作方法

  • 01

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

  • 02

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

  • 03

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

  • 04

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

  • 05

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

  • 06

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

(0)

相关推荐