串連資料庫的有關問題

來源:互聯網
上載者:User
串連資料庫的問題
請問出現這種錯誤怎麼辦?謝謝幫忙!
CDbException
描述
CDbConnection 無法開啟資料庫連線: SQLSTATE[28000] [1045] Access denied for user 'zs6411'@'localhost' (using password: YES)

源檔案
E:\TopShare\htdocs\yii\framework\db\CDbConnection.php(255)

00243: {
00244: if(empty($this->connectionString))
00245: throw new CDbException(Yii::t('yii','CDbConnection.connectionString cannot be empty.'));
00246: try
00247: {
00248: Yii::trace('Opening DB connection','system.db.CDbConnection');
00249: $this->_pdo=$this->createPdoInstance();
00250: $this->initConnection($this->_pdo);
00251: $this->_active=true;
00252: }
00253: catch(PDOException $e)
00254: {
00255: throw new CDbException(Yii::t('yii','CDbConnection failed to open the DB connection: {error}',
00256: array('{error}'=>$e->getMessage())));
00257: }
00258: }
00259: }
00260:
00261: /**
00262: * Closes the currently active DB connection.
00263: * It does nothing if the connection is already closed.
00264: */
00265: protected function close()
00266: {
00267: Yii::trace('Closing DB connection','system.db.CDbConnection');
堆棧追蹤
#0 E:\TopShare\htdocs\yii\framework\db\CDbConnection.php(230): CDbConnection->open()
#1 E:\TopShare\htdocs\yii\framework\db\CDbConnection.php(209): CDbConnection->setActive(true)
#2 E:\TopShare\htdocs\yii\framework\base\CModule.php(353): CDbConnection->init()
#3 E:\TopShare\htdocs\yii\framework\base\CApplication.php(373): CModule->getComponent('db')
#4 E:\TopShare\htdocs\yii\framework\db\ar\CActiveRecord.php(876): CApplication->getDb()
#5 E:\TopShare\htdocs\yii\framework\db\ar\CActiveRecord.php(2242): CActiveRecord->getDbConnection()
#6 E:\TopShare\htdocs\yii\framework\db\ar\CActiveRecord.php(656): CActiveRecordMetaData->__construct(Object(public_user))
#7 E:\TopShare\htdocs\toplinker-web\protected\models\public_user.php(15): CActiveRecord::model('public_user')
#8 E:\TopShare\htdocs\toplinker-web\protected\components\UserIdentity.php(20): public_user::model()
#9 E:\TopShare\htdocs\toplinker-web\protected\models\LoginForm.php(48): UserIdentity->authenticate()
#10 E:\TopShare\htdocs\yii\framework\validators\CInlineValidator.php(39): LoginForm->authenticate('password', Array)
#11 E:\TopShare\htdocs\yii\framework\validators\CValidator.php(163): CInlineValidator->validateAttribute(Object(LoginForm), 'password')
#12 E:\TopShare\htdocs\yii\framework\base\CModel.php(187): CValidator->validate(Object(LoginForm), NULL)
#13 E:\TopShare\htdocs\toplinker-web\protected\controllers\SiteController.php(42): CModel->validate()
#14 E:\TopShare\htdocs\yii\framework\web\actions\CInlineAction.php(32): SiteController->actionLogin()
#15 E:\TopShare\htdocs\yii\framework\web\CController.php(300): CInlineAction->run()
#16 E:\TopShare\htdocs\yii\framework\web\CController.php(278): CController->runAction(Object(CInlineAction))
#17 E:\TopShare\htdocs\yii\framework\web\CController.php(257): CController->runActionWithFilters(Object(CInlineAction), Array)
#18 E:\TopShare\htdocs\yii\framework\web\CWebApplication.php(310): CController->run('login')
#19 E:\TopShare\htdocs\yii\framework\web\CWebApplication.php(120): CWebApplication->runController('site/login')
#20 E:\TopShare\htdocs\yii\framework\base\CApplication.php(135): CWebApplication->processRequest()
#21 E:\TopShare\htdocs\toplinker-web\index.php(11): CApplication->run()
#22 {main}2010-01-25 03:43:00 Apache/2.2.8 (Win32) DAV/2 mod_ssl/2.2.8 OpenSSL/0.9.8g mod_autoindex_color PHP/5.2.5 mod_perl/2.0.3 Perl/v5.8.8 Yii Framework/1.0.10

------解決方案--------------------
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.