欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Navicat 连接 MySQL 失败 : 1130 - Host xxx is not allowed to connect to this MySQL server

程序员文章站 2022-07-01 15:15:51
...

解决Navicat 报错: 1130


1、报错信息

1130 - Host xxx is not allowed to connect to this MySQL server

截图:
Navicat 连接 MySQL 失败 : 1130 - Host xxx is not allowed to connect to this MySQL server

2、报错原因

报错原因:
  是mysql未开启mysql远程访问权限导致。

3、解决办法

授予远程登录权限:

(1)、改表法:

mysql -uroot -ppassword

Navicat 连接 MySQL 失败 : 1130 - Host xxx is not allowed to connect to this MySQL server

mysql>use mysql;
mysql>update user set host = '%' where user = 'root';

(2)、授权法:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION; 

Navicat 连接 MySQL 失败 : 1130 - Host xxx is not allowed to connect to this MySQL server

FLUSH PRIVILEGES; 

Navicat 连接 MySQL 失败 : 1130 - Host xxx is not allowed to connect to this MySQL server

再次连接

Navicat 连接 MySQL 失败 : 1130 - Host xxx is not allowed to connect to this MySQL server
打开数据库:
Navicat 连接 MySQL 失败 : 1130 - Host xxx is not allowed to connect to this MySQL server