MySQL Forums
Forum List  »  PHP

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




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.