Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 0 down vote accepted
  1. Try ssh -f -N *etc*. The -f makes the SSH command run in the background.
  2. Try mysql -h -P 3308 *etc*. The -h 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.
share|improve this answer

Your Answer


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.