Yii Framework Forum: Yii Doesn't Find Pdo Mysql Driver - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Yii Doesn't Find Pdo Mysql Driver Rate Topic: -----

#1 User is offline   Ednei 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 36
  • Joined: 16-May 13

Posted 28 May 2013 - 06:57 PM

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
0

#2 User is offline   Keith 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,668
  • Joined: 04-March 10
  • Location:UK

Posted 29 May 2013 - 03:18 AM

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:

Quote

Also check if you've configured database connection in your protected/config/console.php.

0

#3 User is offline   Ednei 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 36
  • Joined: 16-May 13

Posted 30 May 2013 - 07:45 AM

View PostKeith, on 29 May 2013 - 03:18 AM, said:

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',
		),

0

#4 User is offline   Ednei 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 36
  • Joined: 16-May 13

Posted 03 June 2013 - 09:22 AM

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

I'll try this!
0

#5 User is offline   Ednei 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 36
  • Joined: 16-May 13

Posted 03 June 2013 - 08:45 PM

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

0

Share this topic:


Page 1 of 1
  • 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