日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

MySQL 数据库修改访问权限,不能使用ip连接mysql问题处理:Host ‘host.docker.internal‘ is not allowed to connect to this ...

發(fā)布時間:2025/4/16 51 豆豆
生活随笔 收集整理的這篇文章主要介紹了 MySQL 数据库修改访问权限,不能使用ip连接mysql问题处理:Host ‘host.docker.internal‘ is not allowed to connect to this ... 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

使用 ip 訪問 mysql 數(shù)據(jù)庫報錯,由于默認配置只允許使用 localhost 訪問,我們修改下參數(shù)即可。

An error occurred while establishing the connection:Long Message: null, message from server: "Host 'host.docker.internal' is not allowed to connect to this MySQL server"Details:Type: java.sql.SQLExceptionError Code: 1130SQL State: HY000

報錯翻譯:
空指針,來自服務器的消息:"Host ’ Host .docker.internal’ 不允許連接到 MySQL 服務器"

解決方案:
使用 select user,host from user; 命令查看 root 用戶的 host,可以看到默認是 localhost

修改 root 用戶的 host 為百分號后就可以用 ip 訪問了。
update user set host='%' where user='root';
然后 flush privileges; 使之生效。

喜歡的點個贊?吧!

總結

以上是生活随笔為你收集整理的MySQL 数据库修改访问权限,不能使用ip连接mysql问题处理:Host ‘host.docker.internal‘ is not allowed to connect to this ...的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。