1. 程式人生 > >解決連接mysql報錯1130

解決連接mysql報錯1130

word host 輸入 class 客戶端連接 code 權限 數據庫 ide

最近在服務器上部署好的應用突然間連接不上mysql數據庫,報錯“ERROR 1130: Host xxx.xxx.xxx.xxx is not allowed to connect to this MySQL server”

那麽直接運行如下命令:

mysql -u root -p

彈出Enter password:輸入您的數據庫密碼

鏈接到mysql數據庫。

假如你的用戶是root ,那麽運行如下命令:

GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘您的數據庫密碼‘ WITH GRANT OPTION;

然後刷新一下權限

flush privileges;

大功告成,就可以在客戶端連接mysql服務器了。

解決連接mysql報錯1130