Server Fault is a question and answer site for system and network administrators. 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

When I try to connect to MySQL via Sequel Pro SSH I get the following error:

Unable to connect to host because the port connection via SSH was refused.

Please ensure that your MySQL host is set up to allow TCP/IP connections (no --skip-networking) and is configured to allow connections from the host you are tunnelling via.

You may also want to check the port is correct and that you have the necessary privileges.

Checking the error detail will show the SSH debug log which may provide more details.

MySQL said: Lost connection to MySQL server at 'reading initial communication packet', system error: 0

I checked my my.cnf, and the following section existed:

# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address            =

I am able to successfully connect through SSH and then manually connecting to the MySQL server via the mysqlcommand. How do I make this work? :-)

Thanks in advance.

share|improve this question

I may be mistaken here but I think that if MySQL binds to the localhost it only listens via a socket, so it will not be connectable via localhost:3306 (which is how the tunnelling will work).

Test this by trying to telnet to it: telnet 3306

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.