天天看點

Navicat 報 1130 - Host XXX is not allowed to connect to this MySQL server 錯誤提示的解決辦法

Navicat 報 1130 - Host XXX is not allowed to connect to this MySQL server 錯誤提示的解決辦法
  1. 用Navicat Premium 11.1.13連接配接雲伺服器的資料庫時報錯

    報錯原因:此時的MySQL配置不支援遠端連接配接 。

  2. 登陸伺服器,進入資料庫

    mysql -uroot -p

use mysql;

select host from user where user='root';           

複制

Navicat 報 1130 - Host XXX is not allowed to connect to this MySQL server 錯誤提示的解決辦法
update user set host = '%' where user ='root';           

複制

将localhost設定為通配符%,localhost設定了“%”後便可以允許遠端通路。

‘localhost’ 指的是使用者開放的IP,可以是’localhost’(僅本機通路,相當于127.0.0.1),可以是具體的’...’(具體某一IP),也可以是 ‘%’ (所有IP均可通路)

  • 重新整理權限
flush privileges;           

複制

檢視配置

select host from user where user='root';           

複制

Navicat 報 1130 - Host XXX is not allowed to connect to this MySQL server 錯誤提示的解決辦法

完成後,就可以連接配接成功了。