Host is not allowed to connect to this MySQL server錯誤

虛擬機裝好MySQL發現本地可以連接,遠程卻不行,開放3306端口後出現錯誤:Host 'xxx' is not allowed to connect to this MySQL server

 

解決方案:

本地登錄MySQL之後執行如下命令:

選中mysql數據庫

use mysql;

更新host

update user set host = '%' where user = 'root';

刷新權限

FLUSH PRIVILEGES;

 

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