Connection Via SSH Tunnel (MySQL)

his guide assumes that you have already set up an SSH account. If you have not done it yet, see the link below for a guide that describes how to do this.

setup SSH Account

Due to security considerations we do not allow connections to our normal MySQL server from outside our network. The negative impact it will bring to our customers is that (but on) can not connect to their databases via external software (eg MySQL Workbench) which is troublesome for many who prefer to work on these instead of via our web-based tools (such as phpMyAdmin). the solution to this is to use their SSH account with us to create a tunnel to send their traffic through and thus be able to make the connection from an external location.

Do this to set up an SSH tunnel:

If you use Putty (link to download Putty is below):

download putty

 1. Start Putty and add an account. In the "Host Name" should read and in "Saved Sessions" choose a name for the connection. You can choose the "real name" when you set up the SSH account to avoid confusion.

2. In the left menu, navigate now to Connection> SSH> Tunnels

3. Start by typing 3306 in the "Source port". In the "Destination", enter the host name of the database server followed by :3306 

See picture below:

4. Then click "Add" button (highlighted in the image above).

5. Go back to the Sessions (the same view as the first image in this guide) in the left menu and click "Save".

6. Start up your tunnel by clicking on "Open".

7. Enter your SSH login and password:

 Your SSH tunnel is active! Make sure not to shut down Putty while you should use the tunnel. You can now start working with your database, enter as the host name, and your database data.

You can login using your SQL-client like for example MySQL Workbench. In this example, we use MySQL Workbench, then it looks like this:

To consider

- If you already have a local MySQL server on the same machine that you want to start your SSH tunnel from this will not work as they respond to the same port (3306).