Home  >  Article  >  Database  >  Navicat cannot connect to MySQL remotely

Navicat cannot connect to MySQL remotely

angryTom
angryTomOriginal
2019-08-15 15:29:494284browse

Navicat cannot connect to MySQL remotely

navicat is a powerful visual database management tool. navicat is built with an intuitive graphical user interface, allowing you to create, organize, access and share in a safe and simple way. information. Many users often use navicat software to manage local database files. Today I will introduce to you the solution to the problem that navicat cannot connect to MySQL remotely.

Recommended tutorial: navicat graphic tutorial

##一.can't connect to MySql server on '192.168. INPUT -p tcp --dport 3306 -j ACCEPT 2. #/etc/rc.d/init.d/iptables save
 3. #/etc/init.d/iptables restart

 4. Check whether the port is open#/etc/init.d/iptables status

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

Method 1: Set the mysql user table host equal to the localhost data 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;

Method 2:

1) Connect to the mysql server from any host

GRANT ALL PRIVILEGES ON . TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH   PRIVILEGES;
2) Only allow user root to connect to the mysql server from the host with ip 192.168.x.x and use password As password
GRANT ALL PRIVILEGES ON . TO 'root'@'192.168.x.x' IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH   PRIVILEGES;

3) If you want to allow user root to connect to a certain database of mysql server from the host with ip 192.168.x.x', and use password as password

GRANT ALL PRIVILEGES ON 数据库名.* TO 'root'@'192.168.x.x' IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH   PRIVILEGE

The above is the detailed content of Navicat cannot connect to MySQL remotely. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn