Port tunnelling - MySQL/SSH

fatbusinessman

Fledgling Freddie
Joined
Dec 22, 2003
Messages
810
Ok, here's a reasonably in-depth techie question for you guys:

I'm trying to connect to a MySQL database over a SSH port tunnel. I've got port 1984 on my local machine forwarding to port 3306 on the remote host. I know I've got the port forwarding mechanism right, because I can forward to other ports (specifically, port 80) without any problems. However, when I try to connect to the MySQL database I get the following error:
Code:
ERROR 2013: Lost connection to MySQL server during query
Anyone got any ideas why this is happening? I've tried searching Google and the MySQL site, but to no avail...

(Addendum: I'm using Windows/PuTTY for this, but I've tried it under Linux using the default SSH client, and I get the same error)
 

Shovel

Can't get enough of FH
Joined
Dec 22, 2003
Messages
1,350
This is just theorising:

Presumably you can format direct to the mySQL port? You don't have to forward to another port on the server for the SSH connection and then have something else on top to hook up to mySQL? I guess you can (in theory) due to it working with port 80, but it might be worth trying if such a thing exists.

Alternatively, try mySQL on a different port?
 

fatbusinessman

Fledgling Freddie
Joined
Dec 22, 2003
Messages
810
Ok, problem now solved :)

Something I really should have noticed earlier - my.cnf had the 'skip-networking' directive , but the command-line didn't pick this up because that tries to use pipes by default. So got rid of that and I'm now sorted :)
 

Users who are viewing this thread

Top Bottom