mb1
(mb)
June 23, 2009, 2:18pm
1
Hi Guys!
i have a problem…
DB connection: could not find driver
i must install my mamp new and i had update the yii-framework.
and now, my shell tool dosn't work…
i checked:
Memcache Erweiterung Verfehlt CMemCache
APC Erweiterung Verfehlt CApcCache
i can create a new application via console.
next i set my mysql-connection in the main.php
'db'=>array(
'connectionString'=>'mysql:host=localhost;dbname=xxx',
'username'=>'root',
'password'=>'xxx',
),
at next, i want to create model 'User'
with:
cd path/to/app/
% php protected/yiic.php shell
or
% php -c path/to/php.ini protected/yiic.php shell
-> DB connection: could not find driver
what is wrong?!? - need help - please!!!
qiang
(Qiang Xue)
June 23, 2009, 2:49pm
2
You also need pdo_mysql extension.
mb1
(mb)
June 24, 2009, 7:50am
3
i have found it!
my php.ini file have no rights…
i change the rights and ist works on mac
thinkt4nk
(Thinkt4nk)
November 3, 2010, 7:41pm
4
Wait, what rights? I am having this problem now. It works on my ubuntu box at home, but it doesn’t work on the MAMP server here at work. I had to dig into CDbConnection to even get the error message, but it’s the same error, ‘driver not found’. Did you have to change a directive in php.ini or did you have to change perms associated with the file itself?
~thinkt4nk
diggy
(Digger A)
November 4, 2010, 9:30pm
5
thinkt4nk:
Wait, what rights? I am having this problem now. It works on my ubuntu box at home, but it doesn’t work on the MAMP server here at work. I had to dig into CDbConnection to even get the error message, but it’s the same error, ‘driver not found’. Did you have to change a directive in php.ini or did you have to change perms associated with the file itself?
~thinkt4nk
Try to open console and run next command: php -m
This will show list of installed modules, if it doesn’t show you pdo_mysql, then you need to install it.
Maybe you fixed this already, but I ran into the same problem. So this is for users running into the same error.
I used the default cache component like:
'cache' => array(
'class' => 'system.caching.CDbCache',
)
This creates a sqlite db, that also needs PDO. PDO for sqlite is SEPERATE from PDO_MYSQL.
So check if you have caching enabled and if so, check if it is going to a sqlite db.
kmikz
(Sendobx7)
April 9, 2011, 3:12pm
7
RuudBurger:
Maybe you fixed this already, but I ran into the same problem. So this is for users running into the same error.
I used the default cache component like:
'cache' => array(
'class' => 'system.caching.CDbCache',
)
This creates a sqlite db, that also needs PDO. PDO for sqlite is SEPERATE from PDO_MYSQL.
So check if you have caching enabled and if so, check if it is going to a sqlite db.
Thanks a lot, was having a hard time figuring out why it couldn’t connect to the database, even if pdo_mysql was installed.
szigya
(Szigyartom)
November 29, 2015, 9:22pm
8
I had the same problem, for me it was the CDbHttpSession class. I’ve had to add connectionID parameter to get an informative error message. (The table was missing on my new environment)