Yii Framework Forum: CDbConnection failed to open the DB connection: could not find driver - Yii Framework Forum

Jump to content

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

CDbConnection failed to open the DB connection: could not find driver Help

#1 User is offline   Marina 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 23-April 11

Posted 23 April 2011 - 06:49 PM

I am working on Windows 7 and MYsql

and this is my first time to use yii.

when i try to access Model generator i have this error

CDbConnection failed to open the DB connection: could not find driver

please i need help very quickly
0

#2 User is offline   thuong02 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 31-March 09
  • Location:Ho Chi Minh, Viet Nam

Posted 23 April 2011 - 07:48 PM

View PostMarina, on 23 April 2011 - 06:49 PM, said:

I am working on Windows 7 and MYsql

and this is my first time to use yii.

when i try to access Model generator i have this error

CDbConnection failed to open the DB connection: could not find driver

please i need help very quickly


When generate project structure by yii command, did you change db connection in protected/config before access model generator ?
Dinh Thuong
Yahoo: dinhthuong02@yahoo.com
Skype: dinhthuong02
0

#3 User is offline   Marina 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 23-April 11

Posted 23 April 2011 - 08:05 PM

View Postthuong02, on 23 April 2011 - 07:48 PM, said:

When generate project structure by yii command, did you change db connection in protected/config before access model generator ?


yes i change the configuration in main.php to my database name,password,username
0

#4 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 3,317
  • Joined: 10-October 10
  • Location:Denmark

Posted 23 April 2011 - 08:17 PM

What does the requirement script say?

Make sure that you have installed the necessary php extensions.
"Less noise - more signal"
0

#5 User is offline   _wk_ 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 152
  • Joined: 22-January 10

Posted 27 April 2011 - 06:03 AM

The error says it all really, it cannot make the connection to your database because it cannot find the database driver. Either install the missing driver, or you may have the connectionID configured incorrectly in the config file...
0

#6 User is offline   farshid 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 12-May 11

Posted 12 May 2011 - 08:23 PM

I am using sqlite. I had same error. I uncommented line: extension=php_pdo_sqlite.dll in file php.ini.
0

#7 User is offline   Trenton T. Scott 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 19-May 11

Posted 21 May 2011 - 06:26 PM

View Postfarshid, on 12 May 2011 - 08:23 PM, said:

I am using sqlite. I had same error. I uncommented line: extension=php_pdo_sqlite.dll in file php.ini.


Be sure to restart your web server (Apache) after doing this to reload the configuration/driver(s).
0

#8 User is offline   PeRoChAk 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 586
  • Joined: 26-November 10
  • Location:Lahore, Pakistan

Posted 22 May 2011 - 01:16 PM

Also check this line of code in main.php
			'connectionString' => '[b]mysql[/b]:host=localhost;dbname=lms',

Cheers
Perochak
Web Design - Logo Design - Application Development

My Blog | Forums Comparison
0

#9 User is offline   vdance 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 16
  • Joined: 06-November 11

Posted 06 November 2011 - 04:53 PM

I had this same problem and found this thread.. here's what my problem was

My PHP installed & configured this by default >>
extension=php_sqlite.dll

Yii wants this
extension=php_pdo_sqlite.dll

Best
0

#10 User is offline   CTala 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 109
  • Joined: 17-August 11
  • Location:Chile

Posted 16 September 2013 - 09:31 AM

I had that trouble once, just install the correct connector :

For Mysql
sudo apt-get install php5-mysql

For SQlite
sudo apt-get install php5-sqlite
--
MSc. Cristian Tala Sánchez
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