How to Solve MYSQL ERROR 2003 (HY000): Can’t connect to MySQL server on “host” (10038)
Error when connecting to remote MySQL.
ERROR 2003 (HY000): Can’t connect to MySQL server ‘ip’ (10038)
View error type (Linux systems)
perror 113
1
The results are as follows:
OS error code 113: no route to host
The reason for this error is that the server-side firewall does not open the port used by MySQL program. The default is 3306, and the port can be opened
/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
1
Save the settings and restart the firewall
service iptables save
service iptables restart
Linux Set up open 3306 port solution
Firewall
Enable: service iptables start
Shutdown: service iptables stop
Turn off the firewall for a long time
On: chkconfig iptables on
Turn off: chkconfig iptables off
/sbin/iptables -I INPUT -p tcp –dport 3306 -j ACCEPT #Open port 3306
/sbin/iptables -A INPUT -p tcp –dport 80 -j ACCEPT #Enable port 80
/sbin/iptables -A INPUT -p tcp –dport 22 -j ACCEPT #Open port 22
My local machine is Ubuntu, and I can open it by just typing the above command
/etc/rc.d/init.d/iptables save #Save the configuration
/etc/rc.d/init.d/iptables restart #restart the service
View open ports
/etc/init.d/iptables status
The result is as follows
Table: filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
2 ACCEPT tcp — 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
3 ACCEPT tcp — 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
Similar Posts:
- [Solved] CentOS 7.2 Startup Error: Failed to start IPv4 firewall with iptables
- [Solved] SQLSTATE[HY000] [2003] Can’t connect to MySQL serv
- Docker run error: docker0: iptables: No chain/target/match by that name.
- Remote connection with Navicat mysql:Can ‘t connect to MySQL server (10060)
- How to Solve Linux:No route to host
- FTP connect Error: No route to host [How to Solve]
- [Solved] MYSQL Remote connection 2003 Error: can’t connect to MYSQL server on ”(10060)
- When Navicat connects to a database on a server, there is an error prompt: 1130 ‘* *’ host is not allowed to connect to this MySQL server
- Zabbix-server Error: No route to host [How to Solve]
- Magento SMTP – “could not open socket”