学PHP不久,以前用的是人家搭好的环境AMPServer和NMPServer,但是是PHP5.2的,想用PHP5.3的新特性啊,就自己搭环境,没想到遇到的问题还真不少,phpMyAdmin连不上MySQL数据库。error.log中日志为:
2010/09/01 23:18:27 [error] 4224#4608: *9 upstream timed out (10060: 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) while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET /phpMyAdmin/index.php?token=ec74c92d2e66643912bfaa3633064ccb HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost", referrer: "
http://localhost/phpMyAdmin/
"
我的环境 php 5.3 ;phpMyAdmin3.3.6;MySQL 5.1.50。
后参考以下文章解决了问题:
原文地址: http://hi.baidu.com/guitar_dotnet/blog/item/f02d1b45905929348694736f.html
A connection attempt failed because the connected party did not properly ..
2010年03月14日 星期日 19:47
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.
服务器上安装完mysql后 无法使用?
phpmyadmin啥都连不上~先排除phpmyadmin的配置错误问题
自己写个测试:
“
<?php $link = mysql_connect("localhost", "root", "root") or die("Could not connect: " . mysql_error()); print ("Connected successfully"); mysql_close($link); ?>
”
不行?。。。
再写个
“
<?php $link = mysql_connect("127.0.0.1", "root", "root") or die("Could not connect: " . mysql_error()); print ("Connected successfully"); mysql_close($link); ?>
”
啊哈~通过了
因为php5.3默认是不认localhost的~
把localhost改成127.0.0.1试试?
pass~
希望可以帮上大家
|