After installing the MYSQL server, all operations on this machine are normal, but when remotely accessing the MYSQL server on other machines, I cannot connect.
## I suspect it is Port problem, result: telnet 192.168.1.245 3306It was found that the connection could not be connected. It turned out that the port was restricted by the firewall.Now just need to Just open port 3306 in the firewall.
Open the firewall configuration file
vi /etc/sysconfig/iptables
As shown:
Add this line:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
Similarly, if it is another port, just replace "3306" with the corresponding port.
Then restart the firewall
service iptables restart
The above is the detailed content of How to open port 3306 in linux. For more information, please follow other related articles on the PHP Chinese website!