令人困惑无法打开PDO连接无法连接到MySQL服务器

时间:2013-05-25 07:29:06

标签: mysql pdo database-connection propel

我对PDO与MySQL的连接存在令人困惑的问题。用PHP编写的Web应用程序生成该错误:

exception 'PropelException' with message 'Unable to open PDO connection [wrapped: SQLSTATE[HY000] [2003] Can't connect to MySQL server on '192.168.xxx.xxx' (4)]' in ./lib/symfony/plugins/sfPropelPlugin/lib/vendor/propel/Propel.php:610

令人困惑,因为未达到max_connections限制:

MAX CONNECTIONS
Current max_connections = 1000
Current threads_connected = 8
Historic max_used_connections = 783
The number of used connections is 78% of the configured maximum.
Your max_connections variable seems to be fine.

同时,当我收到此错误时,其他webaplication(无推进)或命令行工具可以很好地连接到MySQL。

其他详情:

  • MySQL 5.5.30
  • PHP 5.3.23
  • 红帽企业Linux服务器版本6.2(圣地亚哥)

1 个答案:

答案 0 :(得分:1)

要解决此问题,您必须谷歌查看原始错误消息(“[2003]无法连接到MySQL服务器”),然后验证所有连接凭据。