0

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.

Doug
  • 119
  • 1
  • 11

2 Answers2

0

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
  • 1,756
  • 11
  • 13
  • 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 Jul 31 '10 at 22:25
  • 1
    ok, I made a new database with remote access enabled and that fixed everything, thanks a lot. – Doug Jul 31 '10 at 22:37
0

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
  • 50,943
  • 13
  • 104
  • 142
  • 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 Jul 31 '10 at 22:25
  • 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 Jul 31 '10 at 22:36