Currently, MySQL is not accessible from the network.
I want to share it so that it is *only* accessible from a specific IP address. How do I do this?
Printable View
Currently, MySQL is not accessible from the network.
I want to share it so that it is *only* accessible from a specific IP address. How do I do this?
Find out what port mySQL is using.
Then ensure that the port is allowed through the firewall.
MySQL usually uses port 3306.
To allow user_ip to access mysql_server_ip, you can use something like :But you haven't told anything about your network configuration ...Code:iptables -A INPUT -p tcp -s user_ip --sport 1024:65535 -d mysql_server_ip --dport 3306 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp -s mysql_server_ip --sport 3306 -d user_ip --dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT