首页 > 数据库 >1130 - Host 'xxx' is not allowed to connect to this MySQL server

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

时间:2023-10-21 11:46:49浏览次数:51  
标签:1130 mysqlpassword GRANT xxx connect allowed mysql mysqluser

  安装mysql-5.7.32数据库时,使用Navicat工具连接数据库时,出现Host 'xxx' is not allowed to connect to this MySQL server,详情如下:

   两种解决方案,任选一个即可:

1、修改mysql数据库用户表数据

 

  执行如下SQL命令:

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

  详情如下:

0

  再次测试,连接成功:

2、授权法

  若允许用户mysqluser使用mysqlpassword作为密码从ip为192.168.33.10的主机连接到mysql服务器,就需要进行如下操作:

GRANT ALL PRIVILEGES ON *.* TO 'mysqluser'@'192.168.33.10' IDENTIFIED BY 'mysqlpassword' WITH GRANT OPTION;

  若允许mysqluser账户和其对应的密码 mysqlpassword从任何主机连接到mysql服务器,就需要进行如下操作:

GRANT ALL PRIVILEGES ON *.* TO 'mysqluser‘@'%' IDENTIFIED BY 'mysqlpassword' WITH GRANT OPTION;

 

标签:1130,mysqlpassword,GRANT,xxx,connect,allowed,mysql,mysqluser
From: https://www.cnblogs.com/RunningSnails/p/17778697.html

相关文章