1

I have a mysql database that is only accessible via internal network IP 10.*:3306 and I want to use my local machine to ultimately setup phpmyadmin to admin it, but I'm first just trying to get the SSH tunnel setup. I am running the command ssh -N admin@host_b_public_ip -L 3308:host_b_internal_ip:3306 but the command just hangs in my terminal. If I open another terminal and attempt mysql -P 3308 -u root -p and enter host_b's mysql root password I get denied. Is there anyway I can test if my connection is open? Is this command suppose to just run in a blocking terminal mode or is it not executing properly? Is what I'm trying to do here even possible?

1 Answer 1

1
  1. Try ssh -f -N *etc*. The -f makes the SSH command run in the background.
  2. Try mysql -h 127.0.0.1 -P 3308 *etc*. The -h 127.0.0.1 tells mysql to try to connect to a network server at localhost, instead of a local server. Because of the port forwarding rule, the network connection is then forwarded to the remote server. If you don't use a -h flag, it just tries to talk to a local MySQL server, and doesn't go over the network at all.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .