I have a very strange problem with SSH Tunnel. I want to connect to a remote MySQL Server using an SSH Tunnel. I have created the tunnel with great success in the past, but for a strange reason it's not OK now. The Tunnel is created as: ssh [email protected] -T -N -L 6603:localhost:3306.
When I try to connect to the remote MySQL Server, the connection is performed on the local MySQL server!
So, I tried to use the ssh [email protected] -T -N -L 6603:remote.com:3306 which is not what all how-tos say, but what the man page do.
No success :( Everything that I have tried is not working and now I am really confused. What is wrong with that setup?
Are you connecting to the server with the -P command line option? Like:
try: ssh -L6603:localhost:3306 ssh [email protected]
aka, forward all traffic to localhost port 6603 to remove.com port 3306
You would then use host: 'localhost' and port 6603 to connect to server.
You can also check to make sure that the local port is not in use (netstat -tnlp for example) and that 3306 is not being blocked by a firewall.