To ssh tunnel from a Mac OS X or Linux box, open a terminal and use the following: ssh -p7822 username@example.com -L 3306:localhost:3306 (if the connection does not work with localhost, please try using 127.0.0.1) The number before "localhost" is the port number for your end of the tunnel; the number after "localhost" is the port on our server's end of the tunnel. If you are running a local MySQL server, you might need to switch the first 3306 to something else (3307, for example). Use that port number when you want to connect to the remote MySQL on our server, and connect to 3306 to connect to your local MySQL server.
[http://wiki.a2hosting.com/index.php/Connecting_to_MySQL_Remotely]