Using MySQL Administrator Over a Secure (ssh) Connection

MySQL Administrator is not designed to work over a secure connection like ssh. By using ssh tunneling, you can connect to your remote MySQL servers from your workstation.

MySQL Tools

Download the MySQL Tools package.
Install the MySQL Tools package. On the Mac, just drag to Applications.

Create the Tunnel

To create the tunnel, open a shell (Terminal on the Mac) and run the following:

$ ssh -N -L3306:127.0.0.1:3306 username@remote_hostname

-N instructs ssh to run silently without creating a remote shell.
-L a:b:c instructs ssh to use port “a” on the local machine and map it (from the remote server’s viewpoint to port c on machine b).
Now you have a secure tunnel to the server.

Use the Right Hostname

If you run on a Un*x based workstation (i.e. Mac or Linux), when you run either the MySQL Administrator or the MySQL Query Browser, set the “Server Hostname” field to “127.0.0.1”.

MySQL Administrator connection dialog

If you skip this step you will receive the following error:
Error Dialog

8 thoughts on “Using MySQL Administrator Over a Secure (ssh) Connection

  1. Pingback: Connecting to MySQL on a remote server via SSH tunnel « Peter Cossey

  2. athosisus

    Mea culpa, mea maxima culpa: I did not followed… I wrote “localhost” instead of “127.0.0.1”. Sorry, for messing up, and thanks for your post…

Leave a Reply