My MySQL server running on a Debian VPS is not allowing external connections. I can connect fine locally, but I do not seem to be able to connect to my server from an external host.

I've made sure it was running on port 3306, and it is. I'm clueless as to why this is happening, and it would be great if someone could help with this.

With my MySQL client I used (HeidiSQL) I got the following error:

SQL Error (2003) in statement #0: Can't connect to MySQL server on ' xx.xxx.xxx.xxx' (10061)


Have you checked that your my.cnf settings are correct?

If you have specified "bind-address =" in the my.cnf

Then your MySQL - server only listens localhost and does not allow remote-connections. It is the default settings in modern MySQL installions.

  • 1
    Remember, of course, restart your MySQL service after any changes :) – JanneHonkonen Jun 25 '13 at 7:35
  • It's indeed set to this. What do I need to change it to? – Deniz Zoeteman Jun 25 '13 at 9:19
  • Got it fixed :) Had to set it to the external IP of the server. Thanks for your help. – Deniz Zoeteman Jun 25 '13 at 17:39
  • Hi, I got the same error while connecting mysql from outside. I tried settings the IP address of the machine in my.cnf that is also not working. (I am using centos6 & mysql server 5.1.67). Is there any other solution for this issue? – Aravindhan Apr 2 '14 at 5:03
  • @DenizZoeteman and @Aravind you can set it to bind-address = – Andrew Oct 23 '16 at 20:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.