CDbException

CDbConnection hibába ütközött az adatbázis kapcsolat felépítése közben: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

/home/mozogj/web/belleza.hu/framework/db/CDbConnection.php(382)

370                 throw new CDbException(Yii::t('yii','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(Yii::t('yii','CDbConnection failed to open the DB connection: {error}',
383                         array('{error}'=>$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(Yii::t('yii','CDbConnection failed to open the DB connection.'),(int)$e->getCode(),$e->errorInfo);
389                 }
390             }
391         }
392     }
393 
394     /**

Stack Trace

#7
+
 /home/mozogj/web/belleza.hu/protected/modules/user/models/User.php(11): CActiveRecord::model("User")
06     const STATUS_ACTIVE=1;
07     const STATUS_BANNED=2;
08     
09     public static function model($className=__CLASS__)
10     {
11         return parent::model($className);
12     }
13 
14     public function tableName()
15     {
16         return Yii::app()->getModule('user')->tableUsers;
#8
+
 /home/mozogj/web/belleza.hu/protected/modules/user/UserModule.php(230): User::model()
225             foreach ($levels[$level] as $l)
226                 $cond .= 'superuser=' .$l. ' OR ';
227                 
228                 $criteria->condition = trim($cond, ' OR '). ')';
229             
230             $admins = User::model()->findAll($criteria);
231             $return_name = array();
232             foreach ($admins as $admin)
233                 array_push($return_name,$admin->username);
234                 
235             self::$_admins[$level] = ($return_name)?$return_name:array('');
#9
+
 /home/mozogj/web/belleza.hu/protected/controllers/PostController.php(33): UserModule::getAdmins()
28                 'actions'=>array('index','view','tag','feed','search', 'index2'),
29                 'users'=>array('*'),
30       ),
31       array('allow', // allow authenticated user to perform 'create' and 'update' actions
32                   'actions'=>array('list','create','update','SuggestTags','delete'),
33                 'users'=>UserModule::getAdmins(),
34       ),
35 
36       array('deny',  // deny all users
37                 'users'=>array('*'),
38       ),
2024-03-28 18:18:55 mz/x Yii Framework/1.1.10