Mysql tunnel on Mac

Subscribe to Mysql tunnel on Mac 2 post(s), 2 voice(s)

 
Avatar rob5 9 post(s)

Hi,

In the past I’ve connected to the mysql cluster from a Windows machine without problems.

I’m now trying to get a tunnelled connection working on a Mac.

I’ve followed the notes on the WIKI re tunneling through to MYSQL (from a MAC) but can’t get a connection. I don’t have MySQL running locally (I stopped the service).

I have a SSH shell running with the tunnel commands as per the WIKI.

Error msg is:

“Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2) (code 2002)”

Can you suggest any pointers to diagnose the problem further?

Cheers

Rob

 
Avatar Caius Administator 13 post(s)

Hi Rob,

I think the wiki page is slightly misleading, in that it tells you to connect to “localhost”. If you do connect to localhost, mysql interprets that as you want to connect to a socket, and looks for the default socket instead. In your case, /tmp/mysql.sock.

You actually want to connect to 127.0.0.1 port 3306 to make sure you use the tunnel.

Personally instead of stopping the local mysql service, I just make the local tunnel port 3305 and tell my client to connect to that instead.

The MySQL GUI I use on the mac is Sequel Pro, which happens to have ssh tunnelling built right into it. You just tell it which host to tunnel through and it deals with setting up the tunnel and connecting to mysql over it.

HTH,
Caius

Signup or login to contribute