Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is the setup: I have 1 debian server deep within the network running a mysql server. I have a second debian server who is exclusively allowed to access the mysql server of the first server. I have a windows machine that talks over a openvpn connection with the second server and has full control over that server.

What i want to do is to be able to connect to mysql from my windows machine. I established an SSH tunnel from the second server to the mysql server running on the first server with:

ssh -L 7777: koen@ -N

This allows me to connect on the second server with mysql using the following lines:

mysql --host= --port=7777 --protocol=TCP -u username -p
mysql --host=localhost --port=7777 --protocol=TCP -u username -p

but not with

mysql --host= --port=7777 --protocol=TCP -u username -p <-- local ip
mysql --host= --protocol=TCP -u username -p <-- openvpn tun ip (also used when connecting from my windows machine)

This has probably something to do with network traffic not being routed from the openvpn interface to the local loopback interface. My networking knowledge is limited at best, perhaps someone here can point me in the right direction.



share|improve this question
@IgnacioVazquez-Abrams - Sure but what i can't figure out is how to open up this tunnel for the other 2 interfaces, especially I want to be able to connect from the outside – Polity Mar 8 '12 at 6:52
up vote 1 down vote accepted

You're missing part of an argument.

ssh -L '*':7777: ...

share|improve this answer
Thanks, that was the problem – Polity Mar 8 '12 at 6:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.