问题描述

使用 Navicat 连接 MySQL8 报错:

1130 - Host '***' is not allowed to connect to this MySOL server

【MySQL8】1130 - Host ‘***‘ is not allowed to connect to this MySOL server-LMLPHP

解决方案

use mysql;

select host ,user from user;
-- 将 root 用户的主机(host)值修改为 '%',即允许从任何主机连接
update user set host = '%' where user ='root';
-- 刷新权限,使修改生效
flush privileges;

【MySQL8】1130 - Host ‘***‘ is not allowed to connect to this MySOL server-LMLPHP
再次测试连接成功
【MySQL8】1130 - Host ‘***‘ is not allowed to connect to this MySOL server-LMLPHP

11-16 19:15