Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

My intent is to have a local port that ultimately forwards to a mysql server on host db.stuff.host.com. However, db.stuff.host.com is only accessible via login.host.com (no root access), and I can't shell in to db.stuff.host.com. So mysql -h db.stuff.host.com works fine from login.host.com, but not my local Win7 computer (ssh is available via msysgit, cygwin, and a GUI program). How can I set things up so that if I run MySQL workbench, say, and point it to localhost:30000, it connects to db.stuff.host.com:3306?

Difficulty: socat and ncat are not and will not be installed.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

This is standard portforwarding if you are using ssh:

ssh -L30000:db.stuff.host.com:3306 user@login.host.com

This says "create a local port 30000 that passes through the ssh session to login.host.com and delivers any data on this port to db.stuff.host.com on port 3306".

share|improve this answer
    
*groan* *punches self in face for being an idiot* –  elhefe Jun 19 '12 at 23:46

Your Answer

 
discard

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.