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' (2)

/var/www/html/protected/extensions/giix-components/MyGxActiveRecord.php(13)

01 <?php
02 
03 class MyGxActiveRecord extends GxActiveRecord {
04     
05     private static $dbmysql= null;
06 
07     protected static function getMysqlDbConnection()
08     {
09         if (self::$dbmysql !== null)
10             return self::$dbmysql;
11         else
12         {
13             self::$dbmysql = Yii::app()->dbmysql;
14             if (self::$dbmysql instanceof CDbConnection)
15             {
16                 self::$dbmysql->setActive(true);
17                 return self::$dbmysql;
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
+
 /var/www/html/protected/extensions/giix-components/MyGxActiveRecord.php(13): CModule->__get("dbmysql")
08     {
09         if (self::$dbmysql !== null)
10             return self::$dbmysql;
11         else
12         {
13             self::$dbmysql = Yii::app()->dbmysql;
14             if (self::$dbmysql instanceof CDbConnection)
15             {
16                 self::$dbmysql->setActive(true);
17                 return self::$dbmysql;
18             }
#5
+
 /var/www/html/protected/models/_base/BaseGlossary.php(21): MyGxActiveRecord::getMysqlDbConnection()
16  */
17 abstract class BaseGlossary extends MyGxActiveRecord {
18 
19     public function getDbConnection()
20     {
21         return self::getMysqlDbConnection();
22     }
23 
24     public static function model($className=__CLASS__) {
25         return parent::model($className);
26     }
#8
+
 /var/www/html/protected/extensions/giix-components/GxActiveRecord.php(26): CActiveRecord::model("Glossary")
21      * composite pk table. Usually a character.
22      */
23     public static $pkSeparator = '-';
24 
25     public static function model($className=__CLASS__) {
26         return parent::model($className);
27     }
28 
29     /**
30      * This method should be overridden to declare related pivot models for each MANY_MANY relationship.
31      * The pivot model is used by {@link saveWithRelated}.
2024-03-19 02:30:01 Apache/2.2.15 (CentOS) Yii Framework/1.1.13