0
点赞
收藏
分享

微信扫一扫

解决java.sql.SQLException: null, message from server: “Host ‘xxx’ is not allowed to connect

深夜瞎琢磨 2022-01-08 阅读 68
javasqlmysql

登录mysql
mysql -uroot -p密码 登陆到数据:
执行use mysql;
select host,user,password from user;
可以看到user为root,host为localhost的话,说明mysql只允许本机连接,那么外网,本地软件客户端就无法连接了。
调整方法:
执行:update user set host=’%’ where user =‘root’;
执行刷新权限:flush privileges;
可以测试外网连接mysql服务器。

举报

相关推荐

0 条评论