[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

OT: mysql through ssh tunnel?



Is it possible to have a MySQL client talk to a MySQL server through an 
SSH tunnel?  I've checked the misc archives and Google but have turned 
up nothing yet.

I have a MySQL server running on an OpenBSD box, and am trying to 
connect from a Linux box (both have OpenSSH -- if version are important 
I can get them).

I can connect just fine without the tunnel.

To create the tunnel I do the following on the Linux machine:

  # sss -L 3306:mysql-server:3360 -l username -N mysql-server

Where mysql-server is my OpenBSD MySQL server and username is my 
username.  It asks me for my password and then just sits there.  Using 
'netstat -an | grep LISTEN' I get the following line:

tcp        0      0 127.0.0.1:3306          0.0.0.0:*            LISTEN

I then attempt to connect as a normal user as follows:

$ mysql -h localhost -u webdb -p testdb
Enter password:
ERROR 2002: Can't connect to local MySQL server through socket 
'/var/run/mysqld/mysqld.sock' (111)

Has anyone had any success getting this to work?

-- 
Adam VanderHook
acidos_(_at_)_users_(_dot_)_sourceforge_(_dot_)_net
http://www.capcol.edu/student/avanderhook/