3

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)

1 Answer 1

7

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

If you have specified "bind-address = 127.0.0.1" 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.

5
  • 1
    Remember, of course, restart your MySQL service after any changes :) Jun 25, 2013 at 7:35
  • It's indeed set to this. What do I need to change it to? Jun 25, 2013 at 9:19
  • Got it fixed :) Had to set it to the external IP of the server. Thanks for your help. Jun 25, 2013 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, 2014 at 5:03
  • @DenizZoeteman and @Aravind you can set it to bind-address = 0.0.0.0
    – Andrew
    Oct 23, 2016 at 20:36

You must log in to answer this question.

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