Using MySQL Administrator Over a Secure (ssh) Connection

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

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

    [...] via Using MySQL Administrator Over a Secure (ssh) Connection | James Reuben Knowles. [...]

  2. athosisus Says:

    So what to do with the error message?

  3. athosisus Says:

    I mean: following your instruction, I’ve got the same error message…

  4. athosisus Says:

    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…

  5. James Reuben Knowles Says:

    Thanks for stopping by.
    I hope it was helpful.
    :)

  6. VPN Lover Says:

    I have to say, SSH was the best thing they ever came out with. You can’t beat its security nor its reliabilty.

Leave a Reply