mysql 5.7连接不上:Host '192.168.87.1' is not allowed to connect to this MysQL server

 命令:

use mysql; --使用mysql这个库

show tables; --查询所有表

select host,user from user;  --查询user表中host、user

update user set Host='%' where User='root'; --更新user为root账号的host,默认是本地

flush privileges; --刷新权限

截图:

 刷新权限后(flush privileges),Navicat mysql 可以连上了。

发布了187 篇原创文章 · 获赞 146 · 访问量 49万+

猜你喜欢

转载自blog.csdn.net/qq_37495786/article/details/103186100