A connection attempt failed because the connected party did not properly ..

学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。
后参考以下文章解决了问题:
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~

 

希望可以帮上大家

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值