Missing Database Connection
Error:
SQLSTATE[HY000] [1045] Access denied for user 'patrolog_demo'@'localhost' (using password: YES) requires a database connection
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 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 3158 → 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 3180 → 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 2631 → Model->getDataSource()
return null;
}
$results = $this->getDataSource()->read($this, $query);
$this->resetAssociations();
- APP/Controller/BooksController.php line 20 → Model->find(string, array)
public function index() {
$this->set('books', $this->Book->find('all', array('conditions' => array(1 => 1))));
}
'all'
array(
'conditions' => array(
(int) 1 => (int) 1
)
)
- [internal function] → BooksController->index()
- CORE/Cake/Controller/Controller.php line 485 → ReflectionMethod->invokeArgs(BooksController, array)
'action' => $request->params['action']
));
}
return $method->invokeArgs($this, $request->params['pass']);
object(BooksController) {
components => array(
[maximum depth reached]
)
name => 'Books'
uses => array(
[maximum depth reached]
)
helpers => array([maximum depth reached])
request => object(CakeRequest) {}
response => object(CakeResponse) {}
viewPath => 'Books'
layoutPath => null
viewVars => array([maximum depth reached])
view => 'index'
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 => 'Book'
modelKey => 'book'
validationErrors => null
Session => object(SessionComponent) {}
RequestHandler => object(RequestHandlerComponent) {}
Book => object(Book) {}
}
array()
- 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 => 'books'
base => '/patrologia/patrologiasearch'
webroot => '/patrologia/patrologiasearch/'
here => '/patrologia/patrologiasearch/books'
}
- CORE/Cake/Routing/Dispatcher.php line 161 → Dispatcher->_invoke(BooksController, CakeRequest, CakeResponse)
));
}
$response = $this->_invoke($controller, $request, $response);
if (isset($request->params['return'])) {
object(BooksController) {
components => array(
[maximum depth reached]
)
name => 'Books'
uses => array(
[maximum depth reached]
)
helpers => array([maximum depth reached])
request => object(CakeRequest) {}
response => object(CakeResponse) {}
viewPath => 'Books'
layoutPath => null
viewVars => array([maximum depth reached])
view => 'index'
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 => 'Book'
modelKey => 'book'
validationErrors => null
Session => object(SessionComponent) {}
RequestHandler => object(RequestHandlerComponent) {}
Book => object(Book) {}
}
object(CakeRequest) {
params => array(
[maximum depth reached]
)
data => array([maximum depth reached])
query => array([maximum depth reached])
url => 'books'
base => '/patrologia/patrologiasearch'
webroot => '/patrologia/patrologiasearch/'
here => '/patrologia/patrologiasearch/books'
}
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 => 'books'
base => '/patrologia/patrologiasearch'
webroot => '/patrologia/patrologiasearch/'
here => '/patrologia/patrologiasearch/books'
}
object(CakeResponse) {
}