- 遠程連接Mysql服務器的數據庫,錯誤代碼是1130,ERROR 1130: Host xxx.xxx.xxx.xxx is not allowed to connect to this MySQL server
- 猜想是無法給遠程連接的用戶權限問題。
- 這樣子操作mysql庫,即可解決。
- 在本機登入mysql后,更改 “mysql” 數據庫里的 “user” 表里的 “host” 項,從”localhost”改稱'%'即可
- mysql -u root -p
- mysql;use mysql;
- mysql;select 'host' from user where user='root';
- mysql;update user set host = '%' where user ='root';
- mysql;flush privileges;
- mysql;select 'host' from user where user='root';
- 第一句:以權限用戶root登錄
- 第二句:選擇mysql庫
- 第三句:查看mysql庫中的user表的host值(即可進行連接訪問的主機/IP名稱)
- 第四句:修改host值(以通配符%的內容增加主機/IP地址),當然也可以直接增加IP地址
- 第五句:刷新MySQL的系統權限相關表
- 第六句:再重新查看user表時,有修改。。
- 重起mysql服務即可完成。
解決遠程連接mysql錯誤1130
