Yii Framework Forum: error koneksi mysql - Yii Framework Forum

Jump to content

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

error koneksi mysql Rate Topic: -----

#21 User is offline   fastcrash 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 245
  • Joined: 10-March 10
  • Location:South Jakarta

Posted 30 December 2010 - 11:16 PM

@rianday coba beberapa opsi ini di cek

1. apa sudah benar user & password databasenya?
2. coba lihat requirmentnya, apa sudah sesuai?
3. di linux terkenal case-sensitif

kalou liat dari errornya, jelas karena salah db, user atau password, but who knows..
0

#22 User is offline   nasrul 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 98
  • Joined: 14-April 09
  • Location:Sorowako - Indonesia

Posted 31 December 2010 - 12:56 PM

View Postrianday, on 30 December 2010 - 11:00 PM, said:

yup ane juga mendapatkan permasalahan yang sama nih.. kurang lebih error report nya seperti ini
DbTest::testConnection()
CDbException: CDbConnection failed to open the DB connection.
...../framework/db/CDbConnection.php:275
...../framework/db/CDbConnection.php:242
...../framework/db/CDbConnection.php:221
...../framework/base/CModule.php:363
...../framework/base/CModule.php:86
...../YII/trackstar/protected/tests/unit/DbTest.php:10


sebelumnya saya menggunakan linux ubuntu 9.10 dan lampp sebeagai web servernya.. mohon bantuannya untuk me-resolve masalah ini


kalau boleh quotekan connectionstring-nya dalam /protected/config/main.php atau sekalian parameter 'db'-nya?
0

#23 User is offline   nasrul 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 98
  • Joined: 14-April 09
  • Location:Sorowako - Indonesia

Posted 05 January 2011 - 09:33 AM

tologn attach parameter 'db' dalam /webapp/protected/config/main.php.
0

#24 User is offline   chambali 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 15-March 15

Posted 22 March 2015 - 07:36 AM

mau tanya gan solusinya gimana , masih newbie


CDbException

CDbConnection failed to open the DB connection: SQLSTATE[42000] [1049] Unknown database 'testdrive'

C:\xampp\yii\framework\gii\generators\crud\CrudCode.php(44)

32 ));
33 }
34
35 public function requiredTemplates()
36 {
37 return array(
38 'controller.php',
39 );
40 }
41
42 public function init()
43 {
44 if(Yii::app()->db===null)
45 throw new CHttpException(500,'An active "db" connection is required to run this generator.');
46 parent::init();
47 }
48
49 public function successMessage()
50 {
51 $link=CHtml::link('try it now', Yii::app()->createUrl($this->controller), array('target'=>'_blank'));
52 return "The controller has been generated successfully. You may $link.";
53 }
54
55 public function validateModel($attribute,$params)
56 {

Stack Trace
#0
+
C:\xampp\yii\framework\db\CDbConnection.php(347): CDbConnection->open()
#1
+
C:\xampp\yii\framework\db\CDbConnection.php(325): CDbConnection->setActive(true)
#2
+
C:\xampp\yii\framework\base\CModule.php(394): CDbConnection->init()
#3
+
C:\xampp\yii\framework\base\CModule.php(103): CModule->getComponent("db")
#4
+
C:\xampp\yii\framework\gii\generators\crud\CrudCode.php(44): CModule->__get("db")
#5
+
C:\xampp\yii\framework\web\CFormModel.php(39): CrudCode->init()
#6
+
C:\xampp\yii\framework\gii\CCodeGenerator.php(153): CFormModel->__construct()
#7
+
C:\xampp\yii\framework\gii\CCodeGenerator.php(63): CCodeGenerator->prepare()
#8
+
C:\xampp\yii\framework\web\actions\CInlineAction.php(49): CCodeGenerator->actionIndex()
#9
+
C:\xampp\yii\framework\web\CController.php(308): CInlineAction->runWithParams(array("r" => "gii/crud/index"))
#10
+
C:\xampp\yii\framework\web\CController.php(286): CController->runAction(CInlineAction)
#11
+
C:\xampp\yii\framework\web\CController.php(265): CController->runActionWithFilters(CInlineAction, array())
#12
+
C:\xampp\yii\framework\web\CWebApplication.php(282): CController->run("index")
#13
+
C:\xampp\yii\framework\web\CWebApplication.php(141): CWebApplication->runController("gii/crud/index")
#14
+
C:\xampp\yii\framework\base\CApplication.php(184): CWebApplication->processRequest()
#15

C:\xampp\htdocs\testyii\index.php(15): CApplication->run()

10
11 // remove the following line when in production mode
12 defined('YII_DEBUG') or define('YII_DEBUG',true);
13
14 require_once($yii);
15 Yii::createWebApplication($config)->run();

2015-03-21 14:28:48 Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1 Yii Framework
0

Share this topic:


  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users