Home > Operation and Maintenance > Linux Operation and Maintenance > How to open port 3306 in linux

How to open port 3306 in linux

(*-*)浩
Release: 2019-05-30 14:43:43
Original
11788 people have browsed it

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.

How to open port 3306 in linux

## I suspect it is Port problem, result:

telnet 192.168.1.245 3306

It 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
Copy after login

As shown:

How to open port 3306 in linux

Add this line:

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
Copy after login
Just add this sentence. Note that this sentence must be added above the last sentence (the addition is open The statement of port 3306 must be before icmp-host-prohibited). Otherwise it will not take effect.

Similarly, if it is another port, just replace "3306" with the corresponding port.

Then restart the firewall

service iptables restart
Copy after login
Done!

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template