views:

88

answers:

3

I am trying to connect to a MySQL database using the mysql_connect() command however I keep getting the error message:

Warning: mysql_connect() [function.mysql-connect]: [2002] A connection attempt failed because the connected party did not (trying to connect via tcp://ravenwolftest.db.4292619.hostedresource.com:3306) in C:\Data\GITA\Web Design\Projects\Ravenwolf\LoginTest.php on line 12

Warning: mysql_connect() [function.mysql-connect]: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:\Data\GITA\Web Design\Projects\Ravenwolf\LoginTest.php on line 12

I searched around in the phpBB folder and found in the config.php folder there was listed a host name, username, and password. I put those into the mysql_connect() line but get the same error. I am also using godaddy.com for web hosting in case that means anything. As for the code itself all I have is:

mysql_connect('ravenwolftest.db.4292619.hostedresource.com','ravenwolftest','password');

Thanks in advance for any help.

A: 

it seems that either the other server is down or does not allow external connections to the database. i would suggest that you enable external access in your godaddy control panel

Christian Smorra
I do remember not enabling some kind of remote access thing, however that was in the setup, do you have any idea where I could change that?
Doug
ok, I made a new database with remote access enabled and that fixed everything, thanks a lot.
Doug
A: 

Do you control the machine ravenwolftest.db.4292619.hostedresource.com? Is MySQL running on it? If it's not your local machine, have you verified that MySQL is permitting connections from your machine?

Charles
I do not control that machine, however I set this up through godaddy.com, so I would assume that MySQL runs and will permit me.
Doug
Assume nothing, especially with low quality hosting providers like GoDaddy. Ask their support techs if they permit outside MySQL connections. The answer is very likely to be "no."
Charles
A: 

or maybe your account is invalid? also the main reason is might be disallow for external connections

purple