I'm going through the Yii tutorial on creating a blog and following the steps. For the database I just imported the test database. Everything was fine.
When I made connection with the database in main.php it is showing the following error:
CDbConnection failed to open the DB connection: SQLSTATE[42000] [1049] Unknown database 'myblog'
The database connection array in main.php is:
//'db'=>array(
// 'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
//),
// uncomment the following to use a MySQL database
'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=myblog',
'emulatePrepare' => true,
'username' => 'root',
'password' => 'root',
'charset' => 'utf8',
'tablePrefix' => 'ia_',
),
What am I doing wrong?