Yii Doesn't Find Pdo Mysql Driver

The yii requirements page says PDO extension + the mysql driver works, phpinfo() says that PDO and the MySQL driver is installed, I have configured the ‘db’ component in the main config file for my project generated with yiic webapp, checked and double checked that the settings are correct (and yes, I am using mysql).

I have made a new migration script in /[mywebapp]/protected/migrations and now I’m trying to run the ./protected/yiic migrate command, but i just get an exception:

exception ‘CDbException’ with message ‘CDbConnection failed to open the DB connection: could not find driver’

At the same time, my gii work perfectly in the browser!

I have no idea what is wrong.

I use Ubuntu 13.04(64bits) + XAMPP

Unless I’m misunderstanding, the migrate command will use the config settings from your console.php config file. Have you set the database config correctly in there?

Confirmed on this page:

Yes, I configured the console.php and main.php and the connection is working when a test with PHPUnit. But, the ./yiic migrate command doesn’t work.


'db'=>array(

			'connectionString' => 'mysql:host=127.0.0.1;dbname=[myDataBase]',

			'emulatePrepare' => true,

			'username' => 'root',

			'password' => '',

			'charset' => 'utf8',

		),

Maybe, the discussion in CBbConnection Failed can solve my problem.

I’ll try this!

Now, I’m with this error:


exception 'CException' with message 'Property "CDbConnection.ConnectionString" is not defined.' in /opt/lampp/htdocs/yii-1.1.13/framework/base/CComponent.php:130