CDbException

CDbConnection failed to open the DB connection: SQLSTATE[HY000] [1045] Access denied for user 'nhnacnqu'@'localhost' (using password: YES)

/home/nhnacnqu/public_html/yii/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
+
 /home/nhnacnqu/public_html/protected/models/Product.php(34): CActiveRecord::model("Product")
29      * @param string $className active record class name.
30      * @return Product the static model class
31      */
32     public static function model($className = __CLASS__)
33     {
34         return parent::model($className);
35     }
36 
37     /**
38      * @return string the associated database table name
39      */
#8
+
 /home/nhnacnqu/public_html/protected/components/MyController.php(26): Product::model()
21         //Gan bien baseUrl vao bien assetDir
22         $this->assetDir = Yii::app()->theme->baseUrl . '/assets/';
23         $this->meta_desc = '';
24         $this->meta_keywords = '';
25         //bai noi bat lon nhat ngoai trang chu
26         $this->item_product_heiglight = Product::model()->findByPk(Option::getItem('item_on_homePage'));
27 
28         //danh sach bai noi bat ngoai trang chu
29 
30         $limit = Option::getItem('limit_project_hl') ? Option::getItem('limit_project_hl') : 9;
31         $this->list_product_heiglight = Product::model()->findAll(array(
#13
+
 /home/nhnacnqu/public_html/index.php(22): CApplication->run()
17 date_default_timezone_set('Asia/Ho_Chi_Minh');
18 defined('YII_DEBUG') or define('YII_DEBUG', true);
19 
20 require_once(dirname(__FILE__) . '/yii/framework/yii.php');
21 $configFile = 'protected/config/main.php';
22 Yii::createWebApplication($configFile)->run();
2016-05-24 22:38:40 Apache/2.4.18 (Unix) OpenSSL/1.0.1e-fips mod_bwlimited/1.4 Yii Framework/1.1.13