Skip to content

ssh tunneling for CocoaMySql

I’m using CocoaMySql as a GUI for doing some db work. It’s much faster than PhpMyAdmin in my opinion.

To connect to remote servers, I needed to set up an ssh tunnel to get around the firewall.

To do this, I opened up a terminal window and typed:

ssh -N username@mysql.server.com -L 8888:127.0.0.1:3306

where username and mysql.server.com are replaced with the appropiate values

Then in CocoaMySQL, I connect with the following:
Host: 127.0.0.1
User: mysql user
Password: mysql password
Port: 8888

The port number is arbitrary, as long as it doesn’t conflict with any other open ports and matches the port used in the ssh command.

Thanks to this thread for providing the answers!

{ 5 } Comments

  1. Wyatt | March 15, 2007 at 12:32 pm | Permalink

    That worked great, thanks. I couldn’t get the ‘built-in’ ssh tunneling to work

  2. Colin Nederkoorn | March 29, 2007 at 7:52 pm | Permalink

    thanks for the tip! I also couldn’t get the built in ssh tunneling working. This saves me spending 100 bucks on Navicat!

  3. Mike | July 31, 2008 at 11:35 am | Permalink

    Just a note to say thank you — this solved a problem I was having!

  4. Jim | November 8, 2008 at 10:58 pm | Permalink

    Thanks for this. I’ve been beating my head against getting it to work with the built-in tunneling dialog, but within two minutes of reading your post I was connected!
    Thanks for sharing!

  5. Dan K. | December 8, 2008 at 8:01 pm | Permalink

    Add me to the “thanks” pile!

Post a Comment

Your email is never published nor shared. Required fields are marked *