项目一直运行的很正常,然后我按照blog样例最后说的启用Schema Caching时出现如下错误。
描述
CDbConnection 无法开启数据库连线: could not find driver
这个错误是在config/main.php中的db中加入 'schemaCachingDuration'=>3600,以后才出现的。
这是config/main.php中的相关代码 'cache'=>array( 'class'=>'CDbCache', ), // uncomment the following to set up database 'db'=>array( 'class'=>'system.db.CDbConnection', 'connectionString'=>'mysql:host=localhost;dbname=mydbname', 'username'=>'myusername', 'password'=>'mypassword', 'charset'=>'UTF8', 'schemaCachingDuration'=>3600, ),