0

今天尝试运行我在 Zend 框架下编码的项目,并连接到远程数据库,我遇到了这 2 个错误:

PDOException: SQLSTATE[HY000] [2002] 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:\wamp\www\trunk\library\Zend\Db\Adapter\Pdo\Abstract.php on line 129

Zend_Db_Adapter_Exception: SQLSTATE[HY000] [2002] 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:\wamp\www\trunk\library\Zend\Db\Adapter\Pdo\Abstract.php on line 144

在它正常工作之前,我不知道今天发生了什么。似乎这是与数据库的连接问题,但问题是问题来自哪里,来自数据库服务器,或者我的项目,以及在哪里。这是第一次,我得到这个错误,我真的不知道这是什么意思。

4

1 回答 1

1

对我来说这听起来像是网络问题,请尝试从应用服务器进行 telnet:

telnet <remote db name/IP> 3306

如果失败,则说明您有网络/防火墙问题。或者数据库没有完全监听该端口或网络。在远程数据库上执行 netstat 以确认:Linux

netstat -an | grep LISTENING

或窗户

netstat -an | find "LISTENING"

如果它正在侦听默认端口,您应该会看到 :3306。

于 2013-11-12T15:59:30.223 回答