To forward a port with ssh:#
ssh -2 -f -C -N user@servername.com -L localport:localhost:remoteport
In this example then, you can use 3307:localhost:3306 to use your local MySQL admin to manage a remote database. In MySQL Admin, collect to port 3307 on 127.0.0.1, NOT localhost!
Connect to MySQL over forwarded port:#
mysql --user=db_role --password=db_user_password --host=127.0.0.1 --port=3307
ssh -f -L 1234:server.example.com:6667 server.example.com sleep 10 irc -c '#users' -p 1234 pinky 127.0.0.1
Linux.Shell - SQL - Networking