Host 'xxx' is not allowed to connect to this MySQL server 解決方法
Host 'xxx' is not allowed to connect to this MySQL server 解決方法
在 Windows 伺服器點選開始選單->執行->輸入“cmd”->進入控制檯,然後cd 進入MySQL 的 bin 目錄下,然後輸入下面的命令:
> MySQL -uroot -p123456
(123456 為 root 使用者的密碼。)
如何開啟MySQL的遠端帳號-2)建立遠端登陸使用者並授權
> grant all PRIVILEGES on testdb.* to root@'192.168.1.1' identified by '123456';上面的語句表示將 test_db 資料庫的所有許可權授權給 root 這個使用者,允許 root 使用者在 192.168.1.101 這個 IP 進行遠端登陸,並設定 root 使用者的密碼為 123456 。
下面引數說明:
all PRIVILEGES 表示賦予所有的許可權給指定使用者,這裡也可以替換為賦予某一具體的許可權,例如select,insert,update,delete,create,drop 等,具體許可權間用“,”半形逗號分隔。
testdb.* 表示上面的許可權是針對於哪個表的,testdb指的是資料庫,後面的 * 表示對於所有的表,由此可以推理出:對於全部資料庫的全部表授權為“*.*”,對於某一資料庫的全部表授權為“資料庫名.*”,對於某一資料庫的某一表授權為“資料庫名.表名”。
root 表示你要給哪個使用者授權,這個使用者可以是存在的使用者,也可以是不存在的使用者。
192.168.1.1 表示允許遠端連線的 IP 地址,如果想不限制連結的 IP 則設定為“%”即可。
123456 為使用者的密碼。
如何開啟MySQL的遠端帳號-3)執行了上面的語句後,再執行下面的語句,方可立即生效。
> flush privileges;
效果如下:
執行成功,則在伺服器的mysql管理工具會出現剛新增的對應IP的遠端訪問使用者。
PS:如果安裝了mysql客戶端管理工具,也可以用工具直接新增新使用者:
然後輸入對應的新使用者資訊即可:
由龐順龍最後編輯於:4年前
內容均為作者獨立觀點,不代表八零IT人立場,如涉及侵權,請及時告知。
相關文章
- Host 'xxx' is not allowed to connect to this MySQL server.MySqlServer
- “Host ‘xxxx‘ is not allowed to connect to this MySQL server“MySqlServer
- 解決MySql報錯:1130 - Host ‘xxx‘ is not allowed to connect to this MySQL server的方法MySqlServer
- Host 'localhost' is not allowed to connect to this MySQL serverlocalhostMySqlServer
- Host is not allowed to connect to this MySQL server 錯誤的處理方法MySqlServer
- 解決mysql Navicat 出錯:1130-host . is not allowed to connect to this MySql server,MySqlServer
- mysql遠端連線 Host * is not allowed to connect to this MySQL serverMySqlServer
- MySQL-1130-host ... is not allowed to connect to this MySql serverMySqlServer
- SQL Error (1130): Host IP is not allowed to connect to this MySQL serverErrorMySqlServer
- 上手MySQL之解決問題:not allowed to connect to this MySQL serverMySqlServer
- Navicat連線centos裡mysql報錯Host is not allowed to connect to this MySQL serverCentOSMySqlServer
- 關於對連線資料庫時出現1130-host “**” is not allowed to connect to this MySql/mariadb server 的錯誤解決方法資料庫MySqlServer
- navicat無法連線遠端的mysql--Host ‘xx.xx.xx.xx‘ is not allowed to connect to this MySQL server“MySqlServer
- 虛擬機器NAT模式下連線mysql報錯:Host '192.168.30.1' is not allowed to connect to this MySQL server虛擬機模式MySqlServer
- 報錯:1130-host ... is not allowed to connect to this MySql server 開放mysql遠端連線 不使用localhostMySqlServerlocalhost
- 【linux】Can't connect to MySQL server on 'XXX' (13)問題解決方式LinuxMySqlServer
- ERROR 1130: Host ***.***.***.*** is not allowed to connect to this MySQL serverERROR 1062 (23000):ErrorMySqlServer
- MySQL問題記錄--Can't connect to MySQL server on localhost (10061)解決方法MySqlServerlocalhost
- Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)解決方法MySqlServer
- 解決Can 't connect to local MySQL server through socket '/tmp/mysql.sock '(2) "MySqlServer
- Mysql host is blocked because of many connection errors;unblock解決方法MySqlBloCError
- 【問題解決】java.sql.SQLException: null, message from server: “Host ‘xxx.xx.xx.xxx‘ is blocked because ofJavaSQLExceptionNullServerBloC
- ERROR 2002 (HY000): Cant connect to local MySQL server through socket的解決方法ErrorMySqlServer
- 解決 connect to host github.com port 22 operation timed outGithub
- 連線mysql時提示is not allowed to connect不允許連線MySql
- 異常解決——GitLab : ssh: connect to host port 22: Connection refusedGitlab
- MySQL server has gone away 問題的解決方法MySqlServerGo
- 解決Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:MySqlREM
- Mysql mysql lost connection to server during query 問題解決方法MySqlServer
- sudo 出現unable to resolve host 解決方法
- xxx is not translated in yyy, zzz 的解決方法
- WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED解決方法REMIDE
- wsl docker 安裝frp內網穿透出現error: dial tcp 127.0.0.1:xxxx: connect: connection refused解決方法DockerFRP內網穿透ErrorTCP127.0.0.1
- Can't Connect to MySQL Server on IP Address (10061) 錯誤的解決方案MySqlServer
- SQL SERVER Msg 7391解決方法SQLServer
- MySQL 中出現報錯提示: ‘Variable ‘XXX‘ is a read only variable‘的解決方法MySql
- 解決Deprecated:mysql_connect():Themysqlextensionisdeprecatedandwillberemovedinthefuture:usemysqliorPDOinsteadinMySqlREM
- sudo時出現unable to resolve host 的解決方法