Database connection "SQLSTATE[HY000] [2002] Connection refused" is missing, or could not be created.
Error:
An Internal Error Has Occurred.
Stack Trace
- CORE/Cake/Model/Datasource/DboSource.php line 260 → Mysql->connect()
));
}
if ($autoConnect) {
$this->connect();
}
- CORE/Cake/Model/ConnectionManager.php line 101 → DboSource->__construct(array)
$conn = self::$_connectionsEnum[$name];
$class = $conn['classname'];
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 3157 → ConnectionManager::getDataSource(string)
if ($dataSource != null) {
$this->useDbConfig = $dataSource;
}
$db = ConnectionManager::getDataSource($this->useDbConfig);
if (!empty($oldConfig) && isset($db->config['prefix'])) {
- CORE/Cake/Model/Model.php line 1092 → Model->setDataSource(string)
* @return void
*/
public function setSource($tableName) {
$this->setDataSource($this->useDbConfig);
$db = ConnectionManager::getDataSource($this->useDbConfig);
- CORE/Cake/Model/Model.php line 3179 → 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 784 → Model->getDataSource()
if ($result !== array('unhandled')) {
return $result;
}
$return = $this->getDataSource()->query($method, $params, $this);
return $return;
- APP/Controller/PostsController.php line 35 → Model->__call(string, array)
$arr = explode('-', $urlSlug);
$urlSlug = current($arr);
$typeName = $this->Catpost->findById($urlSlug);
$this->set('typeName', $typeName);
'findById'
array(
(int) 0 => '514'
)
- APP/Controller/PostsController.php line 35 → Catpost->findById(string)
$arr = explode('-', $urlSlug);
$urlSlug = current($arr);
$typeName = $this->Catpost->findById($urlSlug);
$this->set('typeName', $typeName);
- [internal function] → PostsController->index(string)
- CORE/Cake/Controller/Controller.php line 494 → ReflectionMethod->invokeArgs(PostsController, array)
'action' => $request->params['action']
));
}
return $method->invokeArgs($this, $request->params['pass']);
object(PostsController) {
name => 'Post'
helpers => array(
[maximum depth reached]
)
uses => array(
[maximum depth reached]
)
request => object(CakeRequest) {}
response => object(CakeResponse) {}
viewPath => 'Post'
layoutPath => null
viewVars => array([maximum depth reached])
view => 'index'
layout => 'default'
autoRender => true
autoLayout => true
Components => object(ComponentCollection) {}
components => array(
[maximum depth reached]
)
viewClass => 'View'
View => null
ext => '.ctp'
plugin => null
cacheAction => false
passedArgs => array(
[maximum depth reached]
)
scaffold => false
methods => array(
[maximum depth reached]
)
modelClass => 'Post'
modelKey => 'post'
validationErrors => null
Session => object(SessionComponent) {}
Catpost => object(Catpost) {}
}
array(
(int) 0 => '514-quan-dan-phuong'
)
- CORE/Cake/Routing/Dispatcher.php line 186 → Controller->invokeAction(CakeRequest)
$controller->startupProcess();
$render = true;
$result = $controller->invokeAction($request);
if ($result instanceof CakeResponse) {
object(CakeRequest) {
params => array(
[maximum depth reached]
)
data => array([maximum depth reached])
query => array([maximum depth reached])
url => 'du-an/514-quan-dan-phuong.html'
base => ''
webroot => '/'
here => '/du-an/514-quan-dan-phuong.html'
}
- CORE/Cake/Routing/Dispatcher.php line 161 → Dispatcher->_invoke(PostsController, CakeRequest, CakeResponse)
));
}
$response = $this->_invoke($controller, $request, $response);
if (isset($request->params['return'])) {
object(PostsController) {
name => 'Post'
helpers => array(
[maximum depth reached]
)
uses => array(
[maximum depth reached]
)
request => object(CakeRequest) {}
response => object(CakeResponse) {}
viewPath => 'Post'
layoutPath => null
viewVars => array([maximum depth reached])
view => 'index'
layout => 'default'
autoRender => true
autoLayout => true
Components => object(ComponentCollection) {}
components => array(
[maximum depth reached]
)
viewClass => 'View'
View => null
ext => '.ctp'
plugin => null
cacheAction => false
passedArgs => array(
[maximum depth reached]
)
scaffold => false
methods => array(
[maximum depth reached]
)
modelClass => 'Post'
modelKey => 'post'
validationErrors => null
Session => object(SessionComponent) {}
Catpost => object(Catpost) {}
}
object(CakeRequest) {
params => array(
[maximum depth reached]
)
data => array([maximum depth reached])
query => array([maximum depth reached])
url => 'du-an/514-quan-dan-phuong.html'
base => ''
webroot => '/'
here => '/du-an/514-quan-dan-phuong.html'
}
object(CakeResponse) {
}
- APP/webroot/index.php line 92 → Dispatcher->dispatch(CakeRequest, CakeResponse)
App::uses('Dispatcher', 'Routing');
$Dispatcher = new Dispatcher();
$Dispatcher->dispatch(new CakeRequest(), new CakeResponse(array('charset' => Configure::read('App.encoding'))));
object(CakeRequest) {
params => array(
[maximum depth reached]
)
data => array([maximum depth reached])
query => array([maximum depth reached])
url => 'du-an/514-quan-dan-phuong.html'
base => ''
webroot => '/'
here => '/du-an/514-quan-dan-phuong.html'
}
object(CakeResponse) {
}