Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 am trying to create an SSH tunnel so that I can write data securely to a remote MySQL database. I start by setting up the tunnel:

ssh username@remote -L 3306:

This gets as far as prompting me for a password and then always gives me the following response:

Permission denied, please try again.

I know I have the password correct. I've chnged the password and flushed the privilages and tried again. The user on MySQL is set to accept from any host. The firewall and router have rules for the port.

I feel like I'm missing something obvious but cannot work out what, can anyone help.

share|improve this question
up vote 3 down vote accepted

The username/password that is asked is for the user on the *nix-box, not the mysql-username/password.

Make sure you can log in into the server by issuing the following command:

ssh username@remote
share|improve this answer
Thanks, that was it, stupid mistake on my part. Thaks for your help. – columbo Feb 13 '12 at 16:56

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.