Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of opening Port 3306 by linux

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article is about how linux opens port 3306. The editor thought it was very practical, so I shared it with you as a reference. Let's follow the editor and have a look.

After installing the MYSQL server, all operations are normal on the local machine, but you can't connect to the MYSQL server when accessing the server remotely on other machines.

Suspected to be a port problem, the result:

Telnet 192.168.1.245 3306

Found that the connection can not be connected, the original is that the port is restricted by the firewall.

Now all you need to do is open port 3306 in the firewall.

Open the firewall profile

Vi / etc/sysconfig/iptables

As shown in the figure:

Add this line:

-A RH-Firewall-1-INPUT-m state-- state NEW-m tcp-p tcp-- dport 3306-j ACCEPT

Just add this sentence, and note that it must be added to the last sentence (the additional opening of port 3306 must precede icmp-host-prohibited). Otherwise, it will not take effect.

Similarly, if it is another port, change "3306" to the corresponding port.

Then restart the firewall.

Service iptables restart

Got it!

Thank you for reading! The method of opening port 3306 of linux is shared here. I hope the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, you can share it and let more people see it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report