CDbException

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

/export/wwwdata/itech/www/register-online/framework/db/CDbConnection.php(382)

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

Stack Trace

#8
+
 /export/wwwdata/itech/www/register-online/protected/controllers/RegisterController.php(72): CActiveRecord->__construct()
67     }
68 
69     public function actionCourseSingle($id) {
70         $this->pageTitle = 'ข้อมูลสาขาวิชา';
71         
72         $model = new RegisMajor();
73         $model = $model->findByPk($id);
74 
75         $model = new RegisCourseDetail();
76         $chk_CourseDetail = $model->findByAttributes(array('regis_major_id' => $id));
77 
#18
+
 /export/wwwdata/itech/www/register-online/index.php(13): CApplication->run()
08 defined('YII_DEBUG') or define('YII_DEBUG',true);
09 // specify how many levels of call stack should be shown in each log message
10 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
11 
12 require_once($yii);
13 Yii::createWebApplication($config)->run();
2024-03-29 17:57:24 Apache/2.0.63 (Unix) PHP/5.5.13 Yii Framework/1.1.14