Skip navigation links

MySQL Forums :: PHP :: php cannot make connection to mysql


Advanced Search

php cannot make connection to mysql
Posted by: Joe Bedan ()
Date: December 07, 2009 08:18PM

I have been trying to get phpmyadmin working for the last few days to no avail. I have tried countless things but nothing seems to work.

I am using PHP 5.3.1, Apache 2.2, and MySQL 5.1 under Windows 7.

I now have managed to get the mysql and mysqli extensions to load and am able to reach the phpmyadmin login screen but no matter what I put in the username and password fields it just sits there until eventually it times out with no error message, just a blank page.

When I run this:

<?php
$conn = mysql_connect( "localhost", "root", "password" ) or exit( mysql_error() );
echo "Connected.";
?>'

I get the following:

Warning: mysql_connect() [function.mysql-connect]: [2002] A connection attempt failed because the connected party did not (trying to connect via tcp://localhost:3306) in C:\wwwroot\connected.php on line 2

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:\wwwroot\connected.php on line 2

Fatal error: Maximum execution time of 60 seconds exceeded in C:\wwwroot\connected.php on line 2


It seems like it is not able to connect to mysql at all. Any ideas? I am losing my mind!!

Thanks

Joe

Options: ReplyQuote


Subject Written By Posted
php cannot make connection to mysql Joe Bedan 12/07/2009 08:18PM
Re: php cannot make connection to mysql Matt Pellegrino 12/07/2009 11:13PM
Re: php cannot make connection to mysql Joe Bedan 12/07/2009 11:40PM
Re: php cannot make connection to mysql Robin Thomas 03/03/2010 07:45AM
Re: php cannot make connection to mysql nigel hughes 05/27/2010 10:16PM
Re: php cannot make connection to mysql Joe Bedan 12/08/2009 12:49AM
Re: php cannot make connection to mysql PatrĂ­cio dos Santos 12/10/2009 04:19AM
Re: php cannot make connection to mysql Suryadi cen 12/21/2009 08:21AM
Re: php cannot make connection to mysql Fergal Donlon 01/28/2010 09:25AM
Re: php cannot make connection to mysql Nick Schilling 04/14/2010 09:30PM
Re: php cannot make connection to mysql Nelson Bradley 02/04/2010 01:17PM
Re: php cannot make connection to mysql dev kumar 04/23/2010 08:20AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.