MySQL 数据库修改访问权限,不能使用ip连接mysql问题处理:Host ‘host.docker.internal‘ is not allowed to connect to this ...
生活随笔
收集整理的這篇文章主要介紹了
MySQL 数据库修改访问权限,不能使用ip连接mysql问题处理:Host ‘host.docker.internal‘ is not allowed to connect to this ...
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
使用 ip 訪問 mysql 數據庫報錯,由于默認配置只允許使用 localhost 訪問,我們修改下參數即可。
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 ...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: MySQL 数据库时区设置方法,“The
- 下一篇: SQL Server2019数据库查询所