Mysql遠程連接報錯:SQL Error (1130): Host '192.168.0.18' is not allowed to connect to this MySQL server
通過SQLyog連接linux中的MySQL報錯問題:
SQL Error (1130): Host '192.168.0.18' is not allowed to connect to this MySQL server
說明你所連接的用戶賬戶沒有遠程連接的權限,只能在本機localhost登錄
需要更改 mysql 數據庫里的 user表里的 host字段 把localhost改稱%
下面是我設置的遠程連接步驟,請參考:
1.登錄MySQL
mysql -uroot -proot
2.進入數據庫
use mysql;
3.查看是否有user表
show tables;
4.更改lost字段值
update user set host='%' where host = 'localhost';
update user set host='%' where host = 'localhost';
5.刷新
flush privileges;
flush privileges;
6.查看
select host,user from user;
select host,user from user;

出現上面的界面,說明遠程連接成功,最后quit退出了。。