Solve the problem that nacicat is unable to connect to the remote mysql, and the error 10038 is reported

Time:2021-10-25

Set up the environment with LNMP one click installation package, connect with Navicat, find that it is unable to connect and report an error

Solve the problem that nacicat is unable to connect to the remote mysql, and the error 10038 is reported

  • Log in to MySQL
#mysql -u root -p

2. Modify the user table of MySQL library and change the host entry from localhost to%.% This means that any host is allowed to access. If only one IP is allowed to access, it can be changed to the corresponding IP. For example, the localhost can be changed to 192.168.1.123, which means that only the IP 192.168.1.123 of the LAN is allowed to access MySQL remotely.
Change the database user permissions (note that fill in your own MySQL password in the second line)

mysql> use mysql; 
mysql>grant all privileges on *.* to 'root'@'%' identified by '~~yourpwd~~  ';
mysql> update user set host = '%' where user = 'root'; 
mysql> select host, user from user; 
mysql> flush privileges;

Solve the problem that nacicat is unable to connect to the remote mysql, and the error 10038 is reported
Restart the server Navicat and reconnect

Find or report an error. Set the firewall below

  • Open firewall profile
vim /etc/sysconfig/iptables
  • Change the back of 3306 port to accept

As shown in the figure
Solve the problem that nacicat is unable to connect to the remote mysql, and the error 10038 is reported

  • Then restart the firewall
service iptables restart
  • The test found that the connection was successful

Solve the problem that nacicat is unable to connect to the remote mysql, and the error 10038 is reported

Recommended Today

Swift advanced (XV) extension

The extension in swift is somewhat similar to the category in OC Extension can beenumeration、structural morphology、class、agreementAdd new features□ you can add methods, calculation attributes, subscripts, (convenient) initializers, nested types, protocols, etc What extensions can’t do:□ original functions cannot be overwritten□ you cannot add storage attributes or add attribute observers to existing attributes□ cannot add parent […]