Ssh tunnel to remote MySQL

Posted by Michael Thu, 10 Jan 2008 15:52:00 GMT

You’ve got port 3306 (MySQL) firewalled off and you want to use a MySQL GUI every once in a while (or maybe a bunch).

This is a snap with ssh.

On your local Linux/BSD/Mac/Unix machine (works in cygwin too) edit your .ssh/config file and add:

Host somemysqlserver
 Hostname server.mydomain.com #your mySQL server FQDN or IP
 User bob #replace with your valid ssh server username
 LocalForward *:13306 localhost:3306

Now do:
ssh -f -N somemysqlserver

You can now connect to your localhost port 13306 and it will forward to your MySQL server’s port 3306.

Plus, it’s free and probably already installed on your systems.

Need help? support@imapenguin.com

Posted in , , , , ,  | no comments | no trackbacks

Comments

Trackbacks

Use the following link to trackback from your own site:
http://weblog.imapenguin.com/trackbacks?article_id=ssh-tunnel-to-remote-mysql&day=10&month=01&year=2008

Comments are disabled