mysql异常——Host 'host.docker.internal' is not allowed to connect to this MySQL server使用ip链接失败

报错描述:​
空指针,来自服务器的消息:​"Host ’ Host .docker.internal’​ 不允许连接到 ​MySQL​ 服务器"

登陆mysql
键入命令mysql -uroot -p,回车后提示你输入密码,输入12345,然后回车即可进入到mysql中

选择数据库
use mysql
查询root用户的host
select user,host from user;
修改root的host为%
update user set host='%' where user='root';
刷新修改
然后 ​​flush privileges;​​ 使之生效。

posted @ 2023-12-21 17:09  渝思  阅读(421)  评论(0编辑  收藏  举报