Error Database Connection

i set in main.php mysql for database

but when i test it in yiic shell now works and this error shown:

c:\xampp\htdocs\kash>yiic shell

Yii Interactive Tool v1.1 (based on Yii v1.1.14)

Please type ‘help’ for help. Type ‘exit’ to quit.

>> echo yii::app()->db->connectionString

exception ‘CDbException’ with message 'CDbConnection failed to open the DB connection: SQLSTATE[HY000] [1049] Unknown da

tabase ‘testdrive’’ in C:\xampp\htdocs\framework\db\CDbConnection.php:382

Stack trace:

#0 C:\xampp\htdocs\framework\db\CDbConnection.php(330): CDbConnection->open()

#1 C:\xampp\htdocs\framework\db\CDbConnection.php(308): CDbConnection->setActive(true)

#2 C:\xampp\htdocs\framework\base\CModule.php(387): CDbConnection->init()

#3 C:\xampp\htdocs\framework\base\CModule.php(103): CModule->getComponent(‘db’)

#4 C:\xampp\htdocs\framework\cli\commands\ShellCommand.php(131) : eval()'d code(1): CModule->__get(‘db’)

#5 C:\xampp\htdocs\framework\cli\commands\ShellCommand.php(131): eval()

#6 C:\xampp\htdocs\framework\cli\commands\ShellCommand.php(99): ShellCommand->runShell()

#7 C:\xampp\htdocs\framework\console\CConsoleCommandRunner.php(71): ShellCommand->run(Array)

#8 C:\xampp\htdocs\framework\console\CConsoleApplication.php(92): CConsoleCommandRunner->run(Array)

#9 C:\xampp\htdocs\framework\base\CApplication.php(180): CConsoleApplication->processRequest()

#10 C:\xampp\htdocs\framework\yiic.php(33): CApplication->run()

#11 C:\xampp\htdocs\framework\yiic(14): require_once(‘C:\xampp\htdocs…’)

#12 {main}

Please Help

Console scripts use separate config file, console.php.

thanks, so i must set the mysql in console.php??

Yes, compare it with main.php.

thanks for the answer, i have a same problem and now i can fix it. :D learning by doing but i’am late

Thanks, I solved my problem!