Missing Database Connection
Error:
A Database connection using "Mysql" was missing or unable to connect.
The database server returned this error: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Notice:
If you want to customize this error message, create app/View/Errors/missing_connection.ctp
Stack Trace
- CORE/Cake/Model/Datasource/DboSource.php line 260 → Mysql->connect()
));
}
if ($autoConnect) {
$this->connect();
}
- CORE/Cake/Model/ConnectionManager.php line 105 → DboSource->__construct(array)
'message' => 'Datasource is not found in Model/Datasource package.'
));
}
self::$_dataSources[$name] = new $class(self::$config->{$name});
self::$_dataSources[$name]->configKeyName = $name;
array(
'password' => '*****',
'login' => '*****',
'host' => '*****',
'database' => '*****',
'prefix' => '*****',
'datasource' => 'Database/Mysql',
'persistent' => false,
'encoding' => 'utf8'
)
- CORE/Cake/Model/Model.php line 3476 → ConnectionManager::getDataSource(string)
$this->useDbConfig = $dataSource;
}
$db = ConnectionManager::getDataSource($this->useDbConfig);
if (!empty($oldConfig) && isset($db->config['prefix'])) {
- CORE/Cake/Model/Model.php line 1126 → Model->setDataSource(string)
* @return void
*/
public function setSource($tableName) {
$this->setDataSource($this->useDbConfig);
$db = ConnectionManager::getDataSource($this->useDbConfig);
- CORE/Cake/Model/Model.php line 3498 → Model->setSource(string)
public function getDataSource() {
if (!$this->_sourceConfigured && $this->useTable !== false) {
$this->_sourceConfigured = true;
$this->setSource($this->useTable);
}
- CORE/Cake/Model/Model.php line 2902 → Model->getDataSource()
* @return array
*/
protected function _readDataSource($type, $query) {
$results = $this->getDataSource()->read($this, $query);
$this->resetAssociations();
- CORE/Cake/Model/Model.php line 2874 → Model->_readDataSource(string, array)
return null;
}
return $this->_readDataSource($type, $query);
}
'first'
array(
'conditions' => array(
'id' => 'uuj54q0bakai8h9d4dfpdrbap2'
),
'fields' => null,
'joins' => array(),
'limit' => (int) 1,
'offset' => null,
'order' => array(
(int) 0 => null
),
'page' => (int) 1,
'group' => null,
'callbacks' => true
)
- CORE/Cake/Model/Datasource/Session/DatabaseSession.php line 94 → Model->find(string, array)
public function read($id) {
$row = $this->_model->find('first', array(
'conditions' => array($this->_model->primaryKey => $id)
));
'first'
array(
'conditions' => array(
'id' => 'uuj54q0bakai8h9d4dfpdrbap2'
)
)
- [internal function] → DatabaseSession->read(string)
'uuj54q0bakai8h9d4dfpdrbap2'
- CORE/Cake/Model/Datasource/CakeSession.php line 629 → session_start()
} else {
// For IE<=8
session_cache_limiter("must-revalidate");
session_start();
}
- CORE/Cake/Model/Datasource/CakeSession.php line 198 → CakeSession::_startSession()
}
$id = self::id();
self::_startSession();
- CORE/Cake/Model/Datasource/CakeSession.php line 375 → CakeSession::start()
* @return mixed The value of the session variable
*/
public static function read($name = null) {
if (!self::start()) {
return false;
- CORE/Cake/Controller/Component/SessionComponent.php line 69 → CakeSession::read(string)
* @link http://book.cakephp.org/2.0/en/core-libraries/components/sessions.html#SessionComponent::read
*/
public function read($name = null) {
return CakeSession::read($name);
}
- ROOT/plugins/DebugKit/Controller/Component/ToolbarComponent.php line 161 → SessionComponent->read(string)
DebugMemory::record(__d('debug_kit', 'Component initialization'));
$this->cacheKey .= $this->Session->read('Config.userAgent');
if (
- CORE/Cake/Controller/ComponentCollection.php line 116 → ToolbarComponent->__construct(ComponentCollection, array)
'plugin' => substr($plugin, 0, -1)
));
}
$this->_loaded[$alias] = new $componentClass($this, $settings);
$enable = isset($settings['enabled']) ? $settings['enabled'] : true;
object(ComponentCollection) {
defaultPriority => (int) 10
[protected] _Controller => object(PagesController) {}
[protected] _enabled => array([maximum depth reached])
[protected] _loaded => array(
[maximum depth reached]
)
}
array(
'panels' => array(
'history' => false
)
)
- CORE/Cake/Controller/ComponentCollection.php line 53 → ComponentCollection->load(string, array)
$this->_Controller = $Controller;
$components = ComponentCollection::normalizeObjectArray($Controller->components);
foreach ($components as $name => $properties) {
$Controller->{$name} = $this->load($properties['class'], $properties['settings']);
}
'DebugKit.Toolbar'
array(
'panels' => array(
'history' => false
)
)
- CORE/Cake/Controller/Controller.php line 643 → ComponentCollection->init(PagesController)
$this->uses = (array)$this->uses;
list(, $this->modelClass) = pluginSplit(reset($this->uses));
}
$this->Components->init($this);
return true;
object(PagesController) {
uses => array([maximum depth reached])
components => array(
[maximum depth reached]
)
helpers => array(
[maximum depth reached]
)
paginate => array(
[maximum depth reached]
)
dispatchComponents => array([maximum depth reached])
name => 'Pages'
request => object(CakeRequest) {}
response => object(CakeResponse) {}
viewPath => 'Pages'
layoutPath => null
viewVars => array([maximum depth reached])
view => 'display'
layout => 'default'
autoRender => true
autoLayout => true
Components => object(ComponentCollection) {}
viewClass => 'View'
View => null
ext => '.ctp'
plugin => null
cacheAction => false
passedArgs => array(
[maximum depth reached]
)
scaffold => false
methods => array(
[maximum depth reached]
)
modelClass => 'Page'
modelKey => 'page'
validationErrors => null
[protected] _responseClass => 'CakeResponse'
[protected] _mergeParent => 'AppController'
[protected] _eventManager => object(CakeEventManager) {}
}
- CORE/Cake/Routing/Dispatcher.php line 181 → Controller->constructClasses()
* @return CakeResponse the resulting response object
*/
protected function _invoke(Controller $controller, CakeRequest $request, CakeResponse $response) {
$controller->constructClasses();
$controller->startupProcess();
- CORE/Cake/Routing/Dispatcher.php line 160 → Dispatcher->_invoke(PagesController, CakeRequest, CakeResponse)
));
}
$response = $this->_invoke($controller, $request, $response);
if (isset($request->params['return'])) {
object(PagesController) {
uses => array([maximum depth reached])
components => array(
[maximum depth reached]
)
helpers => array(
[maximum depth reached]
)
paginate => array(
[maximum depth reached]
)
dispatchComponents => array([maximum depth reached])
name => 'Pages'
request => object(CakeRequest) {}
response => object(CakeResponse) {}
viewPath => 'Pages'
layoutPath => null
viewVars => array([maximum depth reached])
view => 'display'
layout => 'default'
autoRender => true
autoLayout => true
Components => object(ComponentCollection) {}
viewClass => 'View'
View => null
ext => '.ctp'
plugin => null
cacheAction => false
passedArgs => array(
[maximum depth reached]
)
scaffold => false
methods => array(
[maximum depth reached]
)
modelClass => 'Page'
modelKey => 'page'
validationErrors => null
[protected] _responseClass => 'CakeResponse'
[protected] _mergeParent => 'AppController'
[protected] _eventManager => object(CakeEventManager) {}
}
object(CakeRequest) {
params => array(
[maximum depth reached]
)
data => array([maximum depth reached])
query => array([maximum depth reached])
url => false
base => ''
webroot => '/'
here => '/'
[protected] _detectors => array(
[maximum depth reached]
)
[protected] _input => ''
}
object(CakeResponse) {
[protected] _statusCodes => array(
[maximum depth reached]
)
[protected] _mimeTypes => array(
[maximum depth reached]
)
[protected] _protocol => 'HTTP/1.1'
[protected] _status => (int) 200
[protected] _contentType => 'text/html'
[protected] _headers => array([maximum depth reached])
[protected] _body => null
[protected] _file => null
[protected] _fileRange => null
[protected] _charset => 'UTF-8'
[protected] _cacheDirectives => array([maximum depth reached])
[protected] _cookies => array([maximum depth reached])
}
- ROOT/webroot/index.php line 108 → Dispatcher->dispatch(CakeRequest, CakeResponse)
$Dispatcher->dispatch(
new CakeRequest(),
new CakeResponse()
);
object(CakeRequest) {
params => array(
[maximum depth reached]
)
data => array([maximum depth reached])
query => array([maximum depth reached])
url => false
base => ''
webroot => '/'
here => '/'
[protected] _detectors => array(
[maximum depth reached]
)
[protected] _input => ''
}
object(CakeResponse) {
[protected] _statusCodes => array(
[maximum depth reached]
)
[protected] _mimeTypes => array(
[maximum depth reached]
)
[protected] _protocol => 'HTTP/1.1'
[protected] _status => (int) 200
[protected] _contentType => 'text/html'
[protected] _headers => array([maximum depth reached])
[protected] _body => null
[protected] _file => null
[protected] _fileRange => null
[protected] _charset => 'UTF-8'
[protected] _cacheDirectives => array([maximum depth reached])
[protected] _cookies => array([maximum depth reached])
}