首頁  >  文章  >  資料庫  >  Navicat遠端連線MySQL連不上

Navicat遠端連線MySQL連不上

angryTom
angryTom原創
2019-08-15 15:29:494237瀏覽

Navicat遠端連線MySQL連不上

navicat是強大的視覺化資料庫管理工具,navicat 是以直覺化的圖形使用者介面而建立的,讓你可以以安全且簡單的方式創建、組織、存取並共用資訊.很多使用者常常會使用navicat軟體來管理本地的資料庫文件,今天小編就為大家介紹一下navicat遠端連線MySQL連線不上的問題的解決方法。

推薦教學:navicat圖文教學

#一.can't connect to MySql server on '192.168.X.X'
  這是因為mysql埠被防火牆攔截,需用linux執行下列指令:

  1、#/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT

  2、#/etc/rc.d/init.d/iptables save

  3、#/etc/init.d/iptables

  3、#/etc/init.d/iptables

  3、#/etc/init.d/iptables  3、#/etc/init.d/iptables  3、#/etc/init.d/iptables

  3、#/etc/init。 restart  4、查看連接埠是否開啟#/etc/init.d/iptables status

二.1130-host ... is not allowed to connect to this MySql server

方法一:把mysql的user表host等於localhost那條資料host=%

mysql -u root -p password>use mysql;
mysql>update user set host = '%' where user = 'root';
mysql>FLUSH   PRIVILEGES;
mysql>select host, user from user;


方法二:

#########1)從任何主機連接到mysql伺服器###
GRANT ALL PRIVILEGES ON . TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH   PRIVILEGES;
###2)只允許使用者root從ip為192.168.x.x的主機連接到mysql伺服器,並使用password作為密碼######
GRANT ALL PRIVILEGES ON . TO 'root'@'192.168.x.x' IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH   PRIVILEGES;
###3)如果你想要允許使用者root從ip為192.168.x.x'的主機連接到mysql伺服器的某個資料庫,並使用password作為密碼##### #
GRANT ALL PRIVILEGES ON 数据库名.* TO 'root'@'192.168.x.x' IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH   PRIVILEGE

以上是Navicat遠端連線MySQL連不上的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn