今天通过navicat连接服务器的MySQL,报错:
host is not allowed to connect to this mysql server
去网上搜了一摞,有些方法不太管用,踩了点坑,在此记录下。
版本:MYSQL 8.0.36, CentOS 7
mysql -u root -p
use mysql;
select user, host from user;
这时候可以看到:只允许localhost
直接改权限:
update user set host='%' where user='root';
flush privileges;
select user, host from user;
此时可看到host已修改,navicat成功连接:
标签:--,mysql,server,host,user,allowed,connect From: https://www.cnblogs.com/aljema/p/18153790