CDbException

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

/home/www/new.stlyrics.com/html/protected/components/MActiveRecord.php(13)

01 <?php
02 class MActiveRecord extends CActiveRecord
03 {
04     private static $art_db = null;
05  
06     protected static function getArtDbConnection()
07     {
08         
09         if (self::$art_db !== null)
10             return self::$art_db;
11         else
12         {
13             self::$art_db = Yii::app()->artdb;
14             if (self::$art_db instanceof CDbConnection)
15             {
16                 self::$art_db->setActive(true);
17                 return self::$art_db;
18             }
19             else
20                 throw new CDbException(Yii::t('yii','Active Record requires a "db" CDbConnection application component.'));
21         }
22     }
23 }
24 ?>

Stack Trace

#4
+
 /home/www/new.stlyrics.com/html/protected/components/MActiveRecord.php(13): CModule->__get("artdb")
08         
09         if (self::$art_db !== null)
10             return self::$art_db;
11         else
12         {
13             self::$art_db = Yii::app()->artdb;
14             if (self::$art_db instanceof CDbConnection)
15             {
16                 self::$art_db->setActive(true);
17                 return self::$art_db;
18             }
#5
+
 /home/www/new.stlyrics.com/html/protected/models/songs/CommonModel.php(11): MActiveRecord::getArtDbConnection()
06 
07     public $route = null;
08     
09     public function getDbConnection()
10     {
11         return self::getArtDbConnection();
12     }    
13 
14     public function getT()
15     {
16         return $this->getTableAlias(false);
#9
+
 /home/www/new.stlyrics.com/html/protected/models/songs/DbArtist.php(227): CActiveRecord->__get("t")
222     }
223 
224     public function defaultScope()
225     {
226         return array(
227             'order'=>$this->t.'.name ASC',
228         );
229     }
230 
231     private function isRename()
232     {
2024-03-29 08:54:27 Apache/2.2.15 Yii Framework/1.1.14