2013-08-16 23 views
0

我試圖設置我的CakePHP,所有其他消息都很好,但我無法修復標題中顯示的此錯誤PDO :: __ construct():[CORE Cake Model Datasource Database Mysql.php

PDO :: __構建體():[CORE \蛋糕\模型\數據源\數據庫\ Mysql.php

此錯誤消息內是

PDO :: _ 構建體() - [內部],線??
Mysql :: connect() - CORE \ Cake \ Model \ Datasource \ Database \ Mysql.php,line 162
DboSource ::
_construct() - CORE \ Cake \ Model \ Datasource \ DboSource.php,line 262
() - CORE \ Cake \ View(#) ConnectionManager :: getDataSource() - CORE \ Cake \ Model \ ConnectionManager.php,第107行
include - APP \ View \ Pages \ home.ctp,line 100
View :: _ evaluate \ View.php,line 945
查看:: _ render() - CORE \ Cake \ View \ View.php,line 907
View :: render() - CORE \ Cake \ View \ View.php,第471行
Controller :: render() - CORE \ Cake \ Controller \ Controller.php,line 948
PagesController :: display() - APP \ Controller \ PagesController.php,line 73
ReflectionMethod :: invokeArgs() - [internal],line? () - CORE \ Cake \ Routing \ Dispatcher.php,第187行
Dispatcher :: dispatch()函數調用者::調用() - CORE \ Cake \ Controller \ Controller.php,行486
Dispatcher :: _ - CORE \蛋糕\路由\ Dispatcher.php,線162
[主] - APP \ webroot的\的index.php,線111

some1能幫助我請,需要幫助>。 <


database.php中的文件:

class DATABASE_CONFIG { 
    public $default = array( 
    'datasource' => 'Database/Mysql', 
    'persistent' => false, 
    'host' => 'local', 
    'login' => 'CakeUser', 
    'password' => 'CakePassword', 
    'database' => 'CakeDB', 
    'prefix' => '', 
    //'encoding' => 'utf8', 
); 
    public $test = array( 
    'datasource' => 'Database/Mysql', 
    'persistent' => false, 
    'host' => 'localhost', 
    'login' => 'user', 
    'password' => 'password', 
    'database' => 'test_database_name', 
    'prefix' => '', 
    //'encoding' => 'utf8',); 
} 
+0

你從哪裏得到的?這看起來像堆棧跟蹤而不是實際的錯誤消息。 –

+0

當我去http:// localhost/cakephp /檢查cakePHP是否設置正確。 –

+0

你可以截屏嗎?某處應該有一個更有用的錯誤消息,而不是堆棧跟蹤。 –

回答

0

你從哪裏弄來的蛋糕?您擁有的蛋糕文件本身可能會出現內容錯誤。去012蛋糕http://cakephp.org/不是一些其他的隨機網站

+0

這是我校的老師提供的副本。正式版本也有同樣的問題,只是嘗試。 –

+0

你可以告訴我你的database.php文件在../ CakePHP的/應用/配置/ –

+0

類DATABASE_CONFIG { \t公共$默認=陣列( \t \t '數據源'=>'數據庫/ MySQL的, \t \t '持久性'=>假, \t \t '主機' => '本地', \t \t '登錄'=> 'CakeUser', \t \t '密碼'=> 'CakePassword', \t \t '數據庫'=> 'CakeDB', \t \t '前綴'=> '', \t \t //'encoding'=>'utf8', \t); \t公共$測試=陣列( \t \t '數據源'=>'數據庫/ MySQL的, \t \t '持久性'=>假, \t \t '主機'=> '本地主機', \t \t「登錄'=> '用戶', \t \t '密碼'=> '密碼', \t \t '數據庫'=> 'test_database_name', \t \t '前綴'=> '', \t \t //' 連接編碼'=>'utf8', \t); } –

相關問題