CDbException

CDbConnection failed to open the DB connection: SQLSTATE[HY000] [1040] Too many connections

/var/www/html/com.fydyyw.www/web/protected/extensions/CPub/CDB.php(94)

082         return $tempData;
083     }
084     /**
085      * 数据库句柄
086      *
087      * @param unknown $dbhandle
088      *            为空:本地配置
089      *            boyang:博扬
090      *            boyue:博跃
091      */
092     private static function getDBHandle($dbhandle) {
093         if (CCheck::isEmpty ( $dbhandle )) {
094             return Yii::app ()->db;
095         }
096         if ($dbhandle == 'boyang') {
097             return Yii::app ()->db_boyang;
098         }
099         if ($dbhandle == 'boyue') {
100             return Yii::app ()->db_boyue;
101         }
102     }
103 
104     /**
105      * SQL语句增删改批处理语句,即:一次执行多条SQL时,使用此方法
106      *

Stack Trace

#4
+
 /var/www/html/com.fydyyw.www/web/protected/extensions/CPub/CDB.php(94): CModule->__get("db")
89      *            boyang:博扬
90      *            boyue:博跃
91      */
92     private static function getDBHandle($dbhandle) {
93         if (CCheck::isEmpty ( $dbhandle )) {
94             return Yii::app ()->db;
95         }
96         if ($dbhandle == 'boyang') {
97             return Yii::app ()->db_boyang;
98         }
99         if ($dbhandle == 'boyue') {
#5
+
 /var/www/html/com.fydyyw.www/web/protected/extensions/CPub/CDB.php(136): CDB::getDBHandle("")
131      *
132      * @param unknown $sql
133      * @return unknown 查询对象 二维数组,如果查询的结果集记录数为0,则数组长度为0
134      */
135     public static function queryAll($sql, $dbhandle = '') {
136         $connection = CDB::getDBHandle ( $dbhandle ); // 获取数据库链接
137         $command = $connection->createCommand ( $sql );
138         $data = $command->queryAll ();
139         return $data;
140     }
141 
#6
+
 /var/www/html/com.fydyyw.www/web/protected/modules/goods/models/MsgSearchModel.php(27): CDB::queryAll("select * , (select area102 from ag_area01 a1 wh...")
22                 (select onetype_name from fyd_goods_onetype a where a.one_id = g.one_id) onetype_name,
23                 (select twotype_name from fyd_goods_twotype b where b.twotype_id = g.twotype_id) twotype_name,
24                 (select threetype_name from fyd_goods_threetype c  where c.threetype_id = g.threetype_id) threetype_name
25                 from  fyd_goods g  , fyd_company c  where  g.user_id = c.user_id  and    goods_id = '".$goods_id."'";
26 
27         return CDB::queryAll($sql);
28 
29     }
30     /**
31      * 正常代理
32      */
2024-03-29 00:11:38 nginx/1.16.0 Yii Framework/1.1.16