MySQL Remote Access (using SSH tunnel)

This brief article describes how to use an SSH tunnel ( to connect to your MySQL database.

Open a Terminal (or Putty in Windows)

$ ssh -L 3307:
Password: <enter the password and leave the login open>

You will need to change w_pfjcd and 4168 to the right values. The MySQL port and password are in ~/.my.cnf on your vhost. Make sure to user and not localhost. Also change dev2 to the appropriate machine your application is hosted on.

Open another terminal

$ mysql -u w_pfjcd -h -P 3307 -p

Once you confirm this works then you should be able to enter the same values from the mysql command into the Query Browser settings or any other local database tool that you prefer to use.

Here are a couple debug commands:

$ netstat -an | grep 3307
$ telnet localhost 3307

More info