Skip to main content

Open port 3306 (without CSF)

Comments

7 comments

  • cPanelLauren
    Hello, If the port was blocked on the server you'd be able to see it when listing the iptables rules in place. The following will show you the service and port number: iptables -L -n
    You could open the port but I wouldn't recommend opening it, just allowing the IP of the remote server to access. If you're just using iptables (no CSF) you'd need to add something like what is listed in the following: Iptables. How to open a port to one ore more specific IP Though you'd change the port number to 3306 and the IP to your remote server's IP address. Thank you,
    0
  • PatrickVeenstra
    root@angels [~]# iptables -I INPUT -p tcp -s --dport 3306 -j ACCEPT [root@vmi174536 ~]# telnet 3306 Trying ... telnet: connect to address : Connection refused
    0
  • cPanelLauren
    it seems as though there's still a block, if you temporarily flush the iptabes rules with: iptables --flush
    are you still unable to connect? You can reinitialize the rules by restarting iptables without saving in the flushed state. Thank you,
    0
  • PatrickVeenstra
    yes I am: root@angels [~]# iptables --flush
    [root@vmi174536 ~]# telnet 3306 Trying ... telnet: connect to address : Connection refused
    0
  • cPanelLauren
    This indicates that without any iptables rules in place the connection is still being blocked. That being said I would suggest that you check any hardware devices such as a router that may be connected to the server to ensure that the port is open in both as well. You may also want to contact your provider to ensure that they're not the source as well. Thank you,
    0
  • PatrickVeenstra
    Here's the fix, I'm glad I contacted official support at the same time: # egrep 'bind|port|#skip-ne' /etc/my.cnf bind-address = 0.0.0.0 port = 3306 #skip-networking
    0
  • cPanelLauren
    Hello, Glad they were able to help you find a solution, it's always best if you open a ticket to allow them to look into the issue as it's much easier to identify the issue when you have access to the server and it eliminates any confusion with more than one person attempting to make changes.
    0

Please sign in to leave a comment.