Navicat MySQL鏈接Linux下MySQL的問題解決方案

Error1: 2003:Can't connect to MySQL server on 'localhost' 

解決方法:關閉Linux的防火牆功能。 javascript

Linux代碼    收藏代碼
  1. #chkconfig iptables off  
  2. #reboot  


Error2: 1130 - Host'ClientIP' is not allowed to connect to this MySQL server 

解決方法:使用root用戶登錄Linux,更改允許登錄的IP地址範圍。 java

Mysql代碼    收藏代碼
  1. mysql>grant all privileges on *.* to 'root'@'%' identified by 'rootpasswd' with grant option;  


這段指令允許全部用root用戶輸入密碼登錄該mysql server,若是將'%' 換乘'192.168.1.124' ,那麼只有'192.168.1.124'的主機能夠登錄。 

如今從新用Navicat鏈接Linux mysql 即可以成功了。mysql

相關文章
相關標籤/搜索