Connect to a MySQL server over SSH in PHP
I would use the autossh tool to create a persistent ssh tunnel to your mysql database. Then all you have to do in your PHP code is point it to localhost. You can test this (without automatic restart) by doing: ssh -L 3306:localhost:3306 [email protected] Setup a ssh key so that you don’t need to use … Read more