The following error occurred while PHP was connecting to MySQL:
Warning:mysql_connect () [Function.mysql-connect]: [2002] A connection attempt failed because the connected party did not (Trying to connect via tcp://localhost:3306) into E:\apache\www\mysql.php on line warning:mysql_connect () [function.mysq L-connect]: A connection attempt failed because the connected party did no properly respond after a period of time, or ES Tablished Connection failed because connected host has failed to respond. In E:\apache\www\mysql.php to
Fatal error:maximum execution time seconds exceeded in E:\apache\www\mysq l.php on line 20
The solution has the following two:
1, the C:\Windows\System32\drivers\etc\ Hosts file
#127.0.0.1 localhost
Note # Remove, you can connect successfully. This solution can also make phpmyadmin normal use.
2, because some PHP version can not turn the localhost to 127.0 0.1, so can be directly 127.0.0.1 can also be successful.