How to open firewall to allow mysql server access from outsi
I have a standalone mysql server and an 'app' server running php/apache. I've set this up according to the instructions set out here:
However, since installing a firewall on the mysql server (using exactly the steps shown here:
Can anyone with iptables knowledge help me out?
Cheers
Jim
2 Replies
-A INPUT -s <your app="" server="" ip="">/32 -p tcp -m tcp --dport 3306 -j ACCEPT</your>
to your firewall config
ssh -L 3306:localhost:3306 user@your.mysql.server.name
You would run this from the app server, and then set the app to connect to localhost for the database. Keep in mind that you would probably want some automatic way to re-establish the ssh session in case it gets closed.