Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SSH tunnel for mysql

Status
Not open for further replies.

jez

Programmer
Apr 24, 2001
370
VN
Hi everyone.

I am trying to create an SSH tunnel for mysql.

The situation is that i want my development server to tunnel to the live database which is behind a firewall.

I have set it up to forward the port to my development machine by doing the following;-
Code:
ssh -v -L [port on my dev machine]:[ip address of live DB]:[port of live db] [user]@[one of the machines that can access the live db]

Now it seems to have worked as i tested with

nc -v localhost [port]

But when i try and connect with mysql from the comamnd line it says i cannot connect.


I think that i am not tuneling from the right place.

My dev machine can access the web servers directly but not the live DB, so the user@machine stuff in my tunnel command was for one of the webservers, is that right.

Any tips would be great, thanks.


Jez
 
What error are you receiving?

It is possible you are not specifying the hostname in the connection arguments?

It is also possible that your database does not have a configuration to permit your user access from that host/client.

D.E.R. Management - IT Project Management Consulting
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top