jdbc连接mysql时报message from server: "Host '**' is not allowed to connect to this MySQL server"错误解决

来源:互联网 发布:关于广州plc编程员招聘 编辑:程序博客网 时间:2024/06/05 07:58

使用JDBC连接mysql时报message from server: "Host 'WHJZ-PC' is not allowed to connect to this MySQL server"错误,如图所示:


出现这种情况的原因是这个数据库的用户不允许从远程登录,只能使用localhost访问。解决办法是在安装mysql的服务器上更改“mysql”数据库里的“user”表中的“HOST”列的值更换为%:

关闭mysql服务,重新开启,再次访问即可成功

0 0
原创粉丝点击