The concept is simple. Bind one of your local machine’s port via a SSH connection to another box on the outside. For example:
ssh -N -L 3307:127.0.0.1:3306 userName@remoteHost &
The above is simply linking the remote machine’s MySQL server on port 3306 to your local machine’s port 3307. In other words, you can now connect to the MySQL server on the remote machine by connecting to localhost:3307.