简体   繁体   English

CakePHP数据库连接“ Mysql”丢失,或无法创建。 core.php和bootstrap.php

[英]CakePHP Database connection “Mysql” is missing, or could not be created. core.php and bootstrap.php

I have looked for answers before I posted this question, and it seems like the problem is in core.php or bootstrap.php file. 在发布此问题之前,我已经寻找了答案,似乎问题出在core.php或bootstrap.php文件中。 I've seen someone said that I need to change prefixes or something like that, but I don't understand what exactly I should change them to. 我见过有人说我需要更改前缀或类似的内容,但是我不知道应该将其更改为什么。 Can someone help me please? 有人能帮助我吗? Here is the error page: 这是错误页面:

Database connection "Mysql" is missing, or could not be created. 数据库连接“ Mysql”丢失,或无法创建。 Error: An Internal Error Has Occurred. 错误:发生内部错误。

Stack Trace
CORE/Cake/Model/Datasource/DboSource.php line 260 → Mysql->connect()
CORE/Cake/Model/ConnectionManager.php line 105 → DboSource->__construct(array)
CORE/Cake/Model/Model.php line 3476 → ConnectionManager::getDataSource(string)
CORE/Cake/Model/Model.php line 1126 → Model->setDataSource(string)
CORE/Cake/Model/Model.php line 3498 → Model->setSource(string)
CORE/Cake/Model/Model.php line 1355 → Model->getDataSource()
CORE/Cake/View/Helper/FormHelper.php line 207 → Model->schema()
CORE/Cake/View/Helper/FormHelper.php line 459 → FormHelper->_introspectModel(string, string)
APP/View/Layouts/default.ctp line 85 → FormHelper->create(string, array)
CORE/Cake/View/View.php line 935 → include(string)
CORE/Cake/View/View.php line 897 → View->_evaluate(string, array)
CORE/Cake/View/View.php line 529 → View->_render(string)
CORE/Cake/View/View.php line 474 → View->renderLayout(string, string)
CORE/Cake/Controller/Controller.php line 952 → View->render(string, null)
APP/Controller/PagesController.php line 69 → Controller->render(string)
[internal function] → PagesController->display(string)
CORE/Cake/Controller/Controller.php line 490 → ReflectionMethod->invokeArgs(PagesController, array)
CORE/Cake/Routing/Dispatcher.php line 185 → Controller->invokeAction(CakeRequest)
CORE/Cake/Routing/Dispatcher.php line 160 → Dispatcher->_invoke(PagesController, CakeRequest, CakeResponse)
APP/webroot/index.php line 108 → Dispatcher->dispatch(CakeRequest, CakeResponse)

Have you the proper connection between the site and the database? 您是否在站点和数据库之间建立了正确的连接? The only reason I can think of for this issue. 我可以想到的唯一原因。 Check you're configuration settings in the database.php file 检查您在database.php文件中的配置设置

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM