Java null, message from server: “Host ‘xxx‘ is not allowed to connect to this MySQL server“文件解决

港控/mmm° 2022-10-22 14:51 376阅读 0赞

问题描述:

java.sql.SQLException: null, message from server: “Host ‘DESKTOP-107D65V’ is not allowed to connect to this MySQL server”

问题分析:

1、root用户只能使用localhost连接,不能使用局域网或外网IP连接。

解决办法:

第一步,进入sql。

第二步,输入use mysql;,选择数据库。

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM4OTc0NjM4_size_16_color_FFFFFF_t_70

第三步,输入 update user set host=’%’ where user=’root’;,修改root用户的权限范围。

20210317173223792.png

第四步,输入flush privileges;,将权限更新操作刷新到内存中。
20210317173856801.png

发表评论

表情:
评论列表 (有 0 条评论,376人围观)

还没有评论,来说两句吧...

相关阅读