Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm trying to connect to a remote MySQL server (with TCP access limited to a specific IP) using port forwarding via SSH, but still haven't figured out how to do it.

Here's what I intend to do:

Local[A] ---> Proxy[B] ---> Remote MySQL[C]

[A] Local machine with Windows

[B] CentOS machine with IP 123.123.123.1 (with it's own MySQL running, btw)

[C] Remote MySQL server with IP 123.123.123.1 authorized on port 3306

How to achieve this?

Thanks in advance.

share|improve this question
    
Do machines B and C really have the same IP address? –  Ignacio Vazquez-Abrams Apr 28 '10 at 21:20
    
Take a look at this question as it's the same concept: serverfault.com/questions/134289 –  GetFree Apr 28 '10 at 21:34

1 Answer 1

up vote 2 down vote accepted

Use PuTTY's port forwarding to forward local port 3306 to port 3306 of machine C, connecting to machine B. If using the command line ssh use:

ssh -L 3306:machineC:3306 username@machineB

then connect to MySQL via localhost:3306.

share|improve this answer
    
Thanks a lot! This worked perfectly :) –  hypeflow Apr 30 '10 at 13:17

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.