CDbException

CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/tmp/mysql-5.sock' (2)

/var/www/tj.21ic.com/tj/statistic/framework/db/CDbConnection.php(381)

369                 throw new CDbException('CDbConnection.connectionString cannot be empty.');
370             try
371             {
372                 Yii::trace('Opening DB connection','system.db.CDbConnection');
373                 $this->_pdo=$this->createPdoInstance();
374                 $this->initConnection($this->_pdo);
375                 $this->_active=true;
376             }
377             catch(PDOException $e)
378             {
379                 if(YII_DEBUG)
380                 {
381                     throw new CDbException('CDbConnection failed to open the DB connection: '.
382                         $e->getMessage(),(int)$e->getCode(),$e->errorInfo);
383                 }
384                 else
385                 {
386                     Yii::log($e->getMessage(),CLogger::LEVEL_ERROR,'exception.CDbException');
387                     throw new CDbException('CDbConnection failed to open the DB connection.',(int)$e->getCode(),$e->errorInfo);
388                 }
389             }
390         }
391     }
392 
393     /**

Stack Trace

#7
+
 /var/www/tj.21ic.com/tj/statistic/protected/models/AdTextlink.php(121): CActiveRecord::model("AdTextlink")
116      * @param string $className active record class name.
117      * @return AdTextlink the static model class
118      */
119     public static function model($className=__CLASS__)
120     {
121         return parent::model($className);
122     }
123     public function getlist($data){
124         $criteria = new CDbCriteria();
125         if($data['subject']){
126             if(strlen($data['subject'])==8){
#8
+
 /var/www/tj.21ic.com/tj/statistic/protected/controllers/AdtextlinkController.php(170): AdTextlink::model()
165      * 前台链接转跳
166      */
167     public function actionR(){
168         $code = Yii::app()->request->getParam('c');
169         $l    = Yii::app()->request->getParam('l');
170         $model = AdTextlink::model()->find("code=:code and flag=1 and endtime>:endtime",array(':code'=>$code,':endtime'=>date('Y-m-d')));
171         $iscrawler = self::isCrawler();
172 
173         if(isset($model->id)){
174             $refrows = $model->url ? explode("\r\n", $model->url) : '';
175             //当有L外参数时需验证URL有效性
#21
+
 /var/www/tj.21ic.com/tj/index.php(49): CApplication->run()
44         defined('YII_DEBUG') or define('YII_DEBUG',true);
45         // specify how many levels of call stack should be shown in each log message
46         //defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',0);
47         require_once($yii);
48 
49         Yii::createWebApplication($config)->run();
50         //Yii::app()->themeManager->setBasePath(dirname(__FILE__).'/statistic/themes/');
51     }
52 
53 
54 ?>
2024-03-29 16:44:00 nginx/1.24.0 Yii Framework/1.1.13