Is not allowed to connect to this mysql server問題解決

is not allowed to connect to this mysql server問題

問題主要反映的是訪問當前MySQL,有些Ip的權限不夠導致。

解決途徑:

  • 登錄MySQL
mysql -u root -p xxx
  • 進入系統mysql的database
use mysql;
  • 查看root賬戶對應的地址範圍
select host from user where user = 'root';
  • 修改地址範圍爲全部(可以根據自己的需要修改地址範圍)
update user set host = '%' where user = 'root';
  • 重啓MySQL服務
# 由於是docker 部署
docker restart xxx(容器ID)

問題解決!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章