gpt4 book ai didi

php - Zend Framework 错误 [数据库连接]

转载 作者:行者123 更新时间:2023-11-29 13:27:30 25 4
gpt4 key购买 nike

今天尝试运行在 Zend Framework 下编码的项目并连接到远程数据库,我遇到了这 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

之前是正常的,今天不知道怎么了。这似乎是数据库的连接问题,但问题是,问题来自哪里,来自数据库服务器,或者我的项目,到底来自哪里。这是我第一次遇到这个错误,我真的不知道这意味着什么。

最佳答案

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

telnet <remote db name/IP> 3306

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

netstat -an | grep LISTENING

或者窗口

netstat -an | find "LISTENING"

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

关于php - Zend Framework 错误 [数据库连接],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19932688/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com