You can connect to a remote mysql server via your localhost very simply and securely. You do this by opening a SSH tunnel on the mysql port.


On a MacBook or Ubuntu/Linux system run this command in your terminal

ssh -L 3306:

Simply replace the username that you have on your mysql server, and replace with your servers IP address or domain.

Once this has been done, keep the terminal open and open a new terminal. Check you can connect to the sql database using either localhost or on port 3306.

Leave a Reply

Your email address will not be published. Required fields are marked *