SSH tunnel

You have to use an SSH tunnel to securely connect to the MySQL database server from remote. Use PuTTY for Windows or OpenSSH for Linux / Mac OS X / *nix.

Tip

Try to connect to the normal shell service before trying to setup a tunnel.

OpenSSH

The following command line must be executed on your local computer:

$ ssh -vNCL 3306:mysql.db.pyrox.eu:3306 pyrox

PuTTY

Please follow the official documentation to setup an SSH tunnel.

The required settings are:

Server Host: ssh.pyrox.eu
Server Port: 22

Tunnel Type: Local
Source Port: 3306
Destination: mysql.db.pyrox.eu:3306

Using the Tunnel

You have to use 127.0.0.1:3306 as the database server address to get routed through the tunnel.

Attention!

Use "127.0.0.1" instead of "localhost". MySQL will try to connect via Unix Domain Socket otherwise!

Example for the local MySQL client:

$ mysql -h 127.0.0.1 -p -u webNNNN-XYZ

Example for Django and the local development server:

DATABASE_HOST = '127.0.0.1'