1

我已经在我的 Windows 8 上安装了 xampp,完成了从 system32/drivers 到 httd conf 和 vhost 文件的所有必要功能,但是当我在浏览器上调用我的网站时出现此错误,请帮助

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000] 
[1203] User username already has more than 'max_user_connections' active connections' 
    in /home/username/public_html/library/Zend/Db/Adapter/Pdo/Abstract.php:129 
Stack trace: 
#0 /home/username/public_html/library/Zend/Db/Adapter/Pdo/Abstract.php(129): 
    PDO->__construct('mysql:host=mysq...', 'username', 'password', Array) 
#1 /home/username/public_html/library/Zend/Db/Adapter/Pdo/Mysql.php(96): 
    Zend_Db_Adapter_Pdo_Abstract->_connect() 
#2 /home/username/public_html/library/Zend/Db/Adapter/Abstract.php(448): 
    Zend_Db_Adapter_Pdo_Mysql->_connect() 
#3 /home/username/public_html/library/Zend/Db/Adapter/Pdo/Abstract.php(238): 
    Zend_Db_Adapter_Abstract->query('SHOW TABLES', Array) 
#4 /home/username/public_html/library/Zend/Db/Adapter/Abstract.php(765): 
    Zend_Db_Adapter_Pdo_Abstract->query('SHOW TABLES', Array) 
#5 /home/username/public_html/library/Zend/Db/Adapter/Pdo/Mysql.php(114): 
    Zend_Db_Adapter_Abstract->fetchCol('SHOW TABLES') 
#6 /home/username/pu in /home/username/public_html/library/Zend/Db/Adapter/Pdo/Abstract.php on line 144
4

1 回答 1

0

这是一个 PDO 错误,PDO 用于处理与数据库的连接。在这里,您可能打开了太多与数据库的连接(您可能每次访问数据库时都会创建一个实例)。您必须关闭数据库或将单例模式与您的类连接一起使用

看看这里:

http://weebtutorials.com/2012/03/pdo-connection-class-using-singleton-pattern/

于 2013-08-07T12:47:41.767 回答