Remember once Navicat for MySQL 10060 error resolution procedures

Recently a lot of overtime, so it is not a long time remote access to your cloud server on MySQLthe database. Today, the local start Nodewhen the service Rom MySQL, as usual is used Navicat For MySQLto connect remote database to check, and found that suddenly the error.

2003-Can’t connect to MySQL server on ‘XXX.XX.XX.XX’(10060)

Check the network

The first reaction was to check the network is not normal, so we immediately pingtest, however, found that not a network problem, you can normally pingpass.

ping XXX.XX.XX.XX

正在 Ping XXX.XX.XX.XX 具有 32 字节的数据:
来自 XXX.XX.XX.XX 的回复: 字节=32 时间=64ms TTL=47
来自 XXX.XX.XX.XX 的回复: 字节=32 时间=86ms TTL=47

Check the security group

Then take a look at the security group set up to think of cloud servers if there are problems, but did not come out until this issue is unlikely to reason with the security group of problems, but still under check is wonderful.

After logging Tencent cloud, found examples of corresponding security group set up properly properly, there is no problem.

Normal security group

Check the user permissions

Because it is my own server, so the use of all rootusers. You need xshellto log in MySQLquery under userthe table.

mysql -uroot -p
输入密码
mysql> use mysql
mysql> select host,user from user;
+-----------+------------------+
| host      | user             |
+-----------+------------------+
| %         | root             |
| localhost | mysql.infoschema |
| localhost | mysql.session    |
| localhost | mysql.sys        |
+-----------+------------------+
4 rows in set (0.00 sec)

Can be found, rootthe corresponding hostShi %, any meaning, it means that rootthe user is connected MySQLwhen not ipconstrained.

So it is not a problem here!

Check the CentOS firewall

It is very easy to overlook one step, many people may think that security groups have been set up, you do not have to check the CentOSfirewall. In fact, it is necessary to check the firewall, we should 3306put on, and then restart the firewall.

[root@VM_0_14_centos ~]# firewall-cmd --permanent --zone=public --add-port=3306/tcp
success
[root@VM_0_14_centos ~]# firewall-cmd --reload
success

Then a look, very pleasant, Navicat for MySQLconnect to a remote database success!

Navicat for MySQL connection is successful

Welcome attention & Communication

Guess you like

Origin www.cnblogs.com/wenbinjiang/p/12511116.html