我对与 MySQL 的 PDO 连接感到困惑。用 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 版(圣地亚哥)