Missing Database Connection
Error:
A Database connection using "Mysql" was missing or unable to connect.
The database server returned this error:
Notice:
If you want to customize this error message, create heneng.com\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 3221 → 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 1108 → Model->setDataSource(string)
* @return void
*/
public function setSource($tableName) {
$this->setDataSource($this->useDbConfig);
$db = ConnectionManager::getDataSource($this->useDbConfig);
- CORE\Cake\Model\Model.php line 3243 → 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 2696 → Model->getDataSource()
return null;
}
$results = $this->getDataSource()->read($this, $query);
$this->resetAssociations();
- APP\Controller\AppController.php line 88 → Model->find(string, array)
//取得登录用户的权限
$this->loadModel("Userright");
$tmpArr = $this->Userright->find("first",array("conditions"=>array("uid"=>$this->Auth->user('id'))));
$rightArr = array();
'first'
array(
'conditions' => array(
'uid' => null
)
)
- APP\Controller\InfoController.php line 6 → AppController->beforeFilter()
function beforeFilter(){
$this->m='Info';
parent::beforeFilter();
$this->local['search_fields']=array(
- [internal function] → InfoController->beforeFilter(CakeEvent)
object(CakeEvent) {
data => null
result => null
[protected] _name => 'Controller.initialize'
[protected] _subject => object(InfoController) {}
[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(InfoController) {},
(int) 1 => 'beforeFilter'
)
object(CakeEvent) {
data => null
result => null
[protected] _name => 'Controller.initialize'
[protected] _subject => object(InfoController) {}
[protected] _stopped => false
}
- CORE\Cake\Controller\Controller.php line 670 → 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(InfoController) {}
[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(InfoController, CakeRequest, CakeResponse)
));
}
$response = $this->_invoke($controller, $request, $response);
if (isset($request->params['return'])) {
object(InfoController) {
autoRender => false
uses => array(
[maximum depth reached]
)
components => array(
[maximum depth reached]
)
helpers => array(
[maximum depth reached]
)
persistModel => false
assign => object(SmartyAssign) {}
local => array(
[maximum depth reached]
)
paginate => null
rightArr => null
name => 'Info'
request => object(CakeRequest) {}
response => object(CakeResponse) {}
viewPath => 'Info'
layoutPath => null
viewVars => array([maximum depth reached])
view => 'show'
layout => 'default'
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 => 'Info'
modelKey => 'info'
validationErrors => null
Smarty => object(SmartyComponent) {}
Auth => object(AuthComponent) {}
Acl => object(AclComponent) {}
Session => object(SessionComponent) {}
m => 'Info'
Info => object(Info) {}
mdl => object(Info) {}
mn => '单页'
args => array(
[maximum depth reached]
)
Userright => object(AppModel) {}
[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 => 'info/show/10.html'
base => ''
webroot => '/'
here => '/info/show/10.html'
[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] _charset => 'UTF-8'
[protected] _cacheDirectives => array([maximum depth reached])
[protected] _cookies => array([maximum depth reached])
}
- APP\webroot\index.php line 98 → 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 => 'info/show/10.html'
base => ''
webroot => '/'
here => '/info/show/10.html'
[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] _charset => 'UTF-8'
[protected] _cacheDirectives => array([maximum depth reached])
[protected] _cookies => array([maximum depth reached])
}