TDbException

Description

TDbConnection failed to establish DB connection: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Source File

/var/www/prado/framework/Data/TDbConnection.php (192)

0181:                 $this->_pdo=new PDO($this->getConnectionString(),$this->getUsername(),
0182:                                     $this->getPassword(),$this->_attributes);
0183:                 // This attribute is only useful for PDO::MySql driver.
0184:                 // Ignore the warning if a driver doesn't understand this.
0185:                 @$this->_pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
0186:                 $this->_pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
0187:                 $this->_active=true;
0188:                 $this->setConnectionCharset();
0189:             }
0190:             catch(PDOException $e)
0191:             {
0192: throw new TDbException('dbconnection_open_failed',$e->getMessage());
0193: } 0194: } 0195: } 0196: 0197: /** 0198: * Closes the currently active DB connection. 0199: * It does nothing if the connection is already closed. 0200: */ 0201: protected function close() 0202: { 0203: $this->_pdo=null; 0204: $this->_active=false;

Stack Trace

#0 /var/www/prado/framework/Data/TDbConnection.php(165): TDbConnection->open()
#1 /var/www/prado/framework/Data/ActiveRecord/TActiveRecord.php(317): TDbConnection->setActive(true)
#2 /var/www/prado/framework/Data/ActiveRecord/TActiveRecord.php(329): TActiveRecord::getActiveDbConnection()
#3 /var/www/prado/framework/Data/ActiveRecord/TActiveRecordGateway.php(136): TActiveRecord->getDbConnection()
#4 /var/www/prado/framework/Data/ActiveRecord/TActiveRecordGateway.php(247): TActiveRecordGateway->getCommand(Object(tbl_bloques))
#5 /var/www/prado/framework/Data/ActiveRecord/TActiveRecord.php(678): TActiveRecordGateway->findRecordsBySql(Object(tbl_bloques), Object(TActiveRecordCriteria))
#6 /var/www/onarc/protected/custom/cCommon.php(34): TActiveRecord->findAllBySql('SELECT DISTINCT...')
#7 /var/www/onarc/protected/custom/cMaster.php(22): cCommon->getBloquesRight()
#8 /var/www/prado/framework/Web/UI/TControl.php(1270): cMaster->OnInit(NULL)
#9 /var/www/prado/framework/Web/UI/TCompositeControl.php(35): TControl->initRecursive(Object(inicio))
#10 /var/www/prado/framework/Web/UI/TTemplateControl.php(240): TCompositeControl->initRecursive(Object(inicio))
#11 /var/www/prado/framework/Web/UI/TControl.php(1255): TTemplateControl->initRecursive(Object(inicio))
#12 /var/www/prado/framework/Web/UI/TCompositeControl.php(35): TControl->initRecursive(NULL)
#13 /var/www/prado/framework/Web/UI/TTemplateControl.php(240): TCompositeControl->initRecursive(NULL)
#14 /var/www/prado/framework/Web/UI/TPage.php(207): TTemplateControl->initRecursive()
#15 /var/www/prado/framework/Web/UI/TPage.php(198): TPage->processNormalRequest(Object(THtmlWriter))
#16 /var/www/prado/framework/Web/Services/TPageService.php(498): TPage->run(Object(THtmlWriter))
#17 /var/www/prado/framework/Web/Services/TPageService.php(444): TPageService->runPage(Object(inicio), Array)
#18 /var/www/prado/framework/TApplication.php(1095): TPageService->run()
#19 /var/www/prado/framework/TApplication.php(382): TApplication->runService()
#20 /var/www/onarc/index.php(23): TApplication->run()
#21 {main}
2017-03-30 10:05 Apache PRADO/3.1.10