a tumblelog
Mon 29 Apr 2019

Create an SSH Tunnel for MySQL Remote Access

To create a SSH tunnel that listens on port 3307 on localhost and connects to port 3306 (MySQL) on use:

ssh -fNL 3307: \

If successful you can login to MySQL running on the remote host by executing on localhost:

mysql -h -P 3307 \

This also works with applications like MySQL Workbench.