Missing Database Connection
Error:
A Database connection using "Mysql" was missing or unable to connect.
The database server returned this error: SQLSTATE[HY000] [2002] Connection refused
Notice:
If you want to customize this error message, create public/View/Errors/missing_connection.ctp
Stack Trace
- CORE/Cake/Model/Datasource/DboSource.php line 262 → Mysql->connect()
));
}
if ($autoConnect) {
$this->connect();
}
- CORE/Cake/Model/ConnectionManager.php line 107 → 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 3288 → ConnectionManager::getDataSource(string)
if ($dataSource) {
$this->useDbConfig = $dataSource;
}
$db = ConnectionManager::getDataSource($this->useDbConfig);
if (!empty($oldConfig) && isset($db->config['prefix'])) {
- CORE/Cake/Model/Model.php line 1107 → Model->setDataSource(string)
* @return void
*/
public function setSource($tableName) {
$this->setDataSource($this->useDbConfig);
$db = ConnectionManager::getDataSource($this->useDbConfig);
- CORE/Cake/Model/Model.php line 3310 → 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 2750 → Model->getDataSource()
* @return array
*/
protected function _readDataSource($type, $query) {
$results = $this->getDataSource()->read($this, $query);
$this->resetAssociations();
- CORE/Cake/Model/Model.php line 2722 → Model->_readDataSource(string, array)
return null;
}
return $this->_readDataSource($type, $query);
}
'first'
array(
'conditions' => null,
'fields' => array(
(int) 0 => 'Setting.site_meta_description',
(int) 1 => 'Setting.site_meta_keywords'
),
'joins' => array(),
'limit' => (int) 1,
'offset' => null,
'order' => array(
(int) 0 => null
),
'page' => (int) 1,
'group' => null,
'callbacks' => true,
'recursive' => (int) -1
)
- APP/Controller/AppController.php line 282 → Model->find(string, array)
$no = $this->Setting->find('first', array(
'fields' => array('Setting.site_meta_description','Setting.site_meta_keywords' ),
'recursive' => -1
));
$keywords_for_layout = "business, kuwaitlocal";
'first'
array(
'fields' => array(
(int) 0 => 'Setting.site_meta_description',
(int) 1 => 'Setting.site_meta_keywords'
),
'recursive' => (int) -1
)
- APP/Controller/AppController.php line 124 → AppController->_setMetaDescriptionKeywords()
$this->response->disableCache();
$this->_setMetaDescriptionKeywords();
$this->_setLanguage();
- APP/Controller/BusinessStarratesController.php line 25 → AppController->beforeFilter()
public function beforeFilter() {
/* $this->Auth->allow('add'); */
parent::beforeFilter();
}
- [internal function] → BusinessStarratesController->beforeFilter(CakeEvent)
object(CakeEvent) {
data => null
result => null
[protected] _name => 'Controller.initialize'
[protected] _subject => object(BusinessStarratesController) {}
[protected] _stopped => false
}
- CORE/Cake/Event/CakeEventManager.php line 248 → call_user_func(array, CakeEvent)
if ($listener['passParams'] === true) {
$result = call_user_func_array($listener['callable'], $event->data);
} else {
$result = call_user_func($listener['callable'], $event);
}
array(
(int) 0 => object(BusinessStarratesController) {},
(int) 1 => 'beforeFilter'
)
object(CakeEvent) {
data => null
result => null
[protected] _name => 'Controller.initialize'
[protected] _subject => object(BusinessStarratesController) {}
[protected] _stopped => false
}
- CORE/Cake/Controller/Controller.php line 674 → CakeEventManager->dispatch(CakeEvent)
* @return void
*/
public function startupProcess() {
$this->getEventManager()->dispatch(new CakeEvent('Controller.initialize', $this));
$this->getEventManager()->dispatch(new CakeEvent('Controller.startup', $this));
object(CakeEvent) {
data => null
result => null
[protected] _name => 'Controller.initialize'
[protected] _subject => object(BusinessStarratesController) {}
[protected] _stopped => false
}
- CORE/Cake/Routing/Dispatcher.php line 184 → Controller->startupProcess()
*/
protected function _invoke(Controller $controller, CakeRequest $request, CakeResponse $response) {
$controller->constructClasses();
$controller->startupProcess();
- CORE/Cake/Routing/Dispatcher.php line 162 → Dispatcher->_invoke(BusinessStarratesController, CakeRequest, CakeResponse)
));
}
$response = $this->_invoke($controller, $request, $response);
if (isset($request->params['return'])) {
object(BusinessStarratesController) {
name => 'BusinessStarrates'
uses => array(
[maximum depth reached]
)
components => array(
[maximum depth reached]
)
helpers => array(
[maximum depth reached]
)
request => object(CakeRequest) {}
response => object(CakeResponse) {}
viewPath => 'BusinessStarrates'
layoutPath => null
viewVars => array([maximum depth reached])
view => 'add'
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 => 'BusinessStarrate'
modelKey => 'business_starrate'
validationErrors => null
Session => object(SessionComponent) {}
RequestHandler => object(RequestHandlerComponent) {}
Cookie => object(CookieComponent) {}
Auth => object(AuthComponent) {}
Setting => object(Setting) {}
[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 => 'business-starrates/add/al-muntaza-carpets-shop/128698'
base => ''
webroot => '/'
here => '/business-starrates/add/al-muntaza-carpets-shop/128698'
[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])
}
- APP/webroot/index.php line 159 → 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 => 'business-starrates/add/al-muntaza-carpets-shop/128698'
base => ''
webroot => '/'
here => '/business-starrates/add/al-muntaza-carpets-shop/128698'
[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])
}