2013-07-05 180 views
0

我正在安裝一個自定義的Zend安裝,當我在瀏覽器中訪問index.php時出現此錯誤。Zend框架mysql php自定義安裝

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[28000] [1045] 
Access denied for user 'sitename'@'localhost' (using password: NO)' in 
/home3/sitename/public_html/Zend/Db/Adapter/Pdo/Abstract.php:129 Stack trace: #0 
/home3/sitename/public_html/Zend/Db/Adapter/Pdo/Abstract.php(129): PDO- 
>__construct('mysql:host=loca...', '', '', Array) #1 


/home3/sitename/public_html/Zend/Db/Adapter/Pdo/Mysql.php(96): Zend_Db_Adapter_Pdo_Abstract->_connect() 

#2 /home3/sitename/public_html/Zend/Db/Adapter/Abstract.php(448): Zend_Db_Adapter_Pdo_Mysql->_connect() 

#3 /home3/sitename/public_html/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array) 

#4 /home3/sitename/application/bootstrap.php(65): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8') 

#5 /home3/sitename/public_html/Zend/Application/Bootstrap/BootstrapAbstract.php(665): Bootstrap->_initDB() 

#6 /home3/sitename/public_html/Zend/Application/Bootstrap/BootstrapAbstract.php(618): Zend_Application_Bootstrap_BootstrapAbstract- in /home3/sitename/public_html/Zend/Db/Adapter/Pdo/Abstract.php on line 144 

任何幫助,將不勝感激。我相信我的目錄結構是正確的,但是正確方向的任何幫助都可以做到。

+0

使用MySQL或sql.if RU UR用mysql更改連接PDO到MySQL。查這個網址一次HTTP://framework.zend。 com/manual/1.12/zh/zend.db.adapter.html – nickle

+2

您的主機,用戶名,密碼或數據庫名稱是錯誤的 – Prisoner

+0

我似乎無法找到添加我新創建的數據庫的詳細信息的文件? –

回答

0

檢查你的application.ini,在/應用/ CONFIGS

resources.db.adapter = "Pdo_Mysql" 
resources.db.params.host = "localhost" 
resources.db.params.username = "root" 
resources.db.params.password = "" 
resources.db.params.dbname = "database" 
resources.db.params.charset = "utf8"