Page 1 of 1

Can't connect to MySQL server (10061)

Posted: 22 Jun 2010, 11:15
by DarkRanger
I get this error when I try to connect to the database:

Code: Select all

Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on '41.72.132.170' (10061) in C:\xampp\htdocs\intraweb\dynam_code\dbconnect.php on line 7
Could not connect to MySQL Server.
Any help regarding this?

Re: Can't connect to MySQL server (10061)

Posted: 22 Jun 2010, 11:33
by Ron2K
Check your connection details (server name, database name, username, password) - most likely, one or more of those are incorrect.

Re: Can't connect to MySQL server (10061)

Posted: 22 Jun 2010, 11:42
by DarkRanger
Ron2K wrote:Check your connection details (server name, database name, username, password) - most likely, one or more of those are incorrect.
If I use an ip to connect to the db server, is that a problem?

Re: Can't connect to MySQL server (10061)

Posted: 22 Jun 2010, 11:51
by Bladerunner
DarkRanger wrote:
Ron2K wrote:Check your connection details (server name, database name, username, password) - most likely, one or more of those are incorrect.
If I use an ip to connect to the db server, is that a problem?
Did you specify port 3306? (or whatever port is applicable in your case)

Re: Can't connect to MySQL server (10061)

Posted: 22 Jun 2010, 12:01
by DarkRanger
Bladerunner wrote:Did you specify port 3306? (or whatever port is applicable in your case)
Yes I did. Port on the server is 3306. One of the first things I checked. Also put it in as 41:72:132:170:3306

Re: Can't connect to MySQL server (10061)

Posted: 22 Jun 2010, 12:53
by Bladerunner
DarkRanger wrote:
Bladerunner wrote:Did you specify port 3306? (or whatever port is applicable in your case)
Yes I did. Port on the server is 3306. One of the first things I checked. Also put it in as 41:72:132:170:3306
You mean 41.72.132.170:3306 ?

Re: Can't connect to MySQL server (10061)

Posted: 22 Jun 2010, 13:40
by DarkRanger
Bladerunner wrote:
DarkRanger wrote:
Bladerunner wrote:Did you specify port 3306? (or whatever port is applicable in your case)
Yes I did. Port on the server is 3306. One of the first things I checked. Also put it in as 41:72:132:170:3306
You mean 41.72.132.170:3306 ?
yes. my bad!!

Re: Can't connect to MySQL server (10061)

Posted: 24 Jun 2010, 09:52
by DarkRanger
For those who might have the same problem, here is the fix:

head over to your MySQL config file: /etc/mysql/my.conf and comment the line that says bind_address. That works...