[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
OT: mysql through ssh tunnel?
- To: misc_(_at_)_openbsd_(_dot_)_org
- Subject: OT: mysql through ssh tunnel?
- From: Adam VanderHook <avanderhook_(_at_)_capitol-college_(_dot_)_edu>
- Date: Mon, 5 Mar 2001 19:52:08 -0500
- Reply-to: acidos_(_at_)_users_(_dot_)_sourceforge_(_dot_)_net
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
ERROR 2002: Can't connect to local MySQL server through socket
Has anyone had any success getting this to work?