How to Connect to MySQL via SSH Tunnel in Windows

This Plone tutorial teaches you how to connect to localhost:3306 with MySQL Query Browser by building SSH tunnel in Windows.

If you want to connect to MySQL server from "outside", not from Plone, you have to build SSH tunnel to connect.

Open PuTTY, specify Host Name, which is a server name that can be found at your Quintagroup account (https://my.quintagroup.com/username). This is something like login.quintagroup.com. Then press Open.

session

You might get PuTTY Security Alert, like the one below. Press Yes and continue your work.

host-key-approval

Now type your SSH login and password and you will be in.
login-as

Now it's time to build SSH tunnel. Right click of the mouse and select Change Settings...
change-settings

Open Tunnels tab in the SSH section.
tunnels

In the Source port box enter 3306. This is the port PuTTY will listen on on your local machine. In the Destination field enter 127.0.0.1:3306. This means, from the server, forward the connection to IP 127.0.0.1 port 3306. MySQL by default listens on port 3306 and we're connecting locally to the server itself, i.e. 127.0.0.1.

Click the Add button.
add

The screen should look like this, then press Apply.

apply

Now the SSH tunnel is created. You can check whether it is working through cmd.
Type in a command line telnet 127.0.0.1 3306
cmd

As soon as you get the response (like the one below) be sure your SSH tunnel is working.
cmd1

Now connect to MySQL server as if it is running on your local system (localhost:3306) using user, password and database from MySQL access details at https://my.quintagroup.com/username/mysql

Connect with our experts Let's talk