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 (with it's own MySQL running, btw)

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

How to achieve this?

Thanks in advance.


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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