Store Cdbcache


I have a litle problem with CDbCache

I set in config/main.php the CDbCache with

‘cache’ => array(

        'class' => 'CDbCache',


Everything is ok but CDbCache creates a file cache-1.1.12.db rather than storing the data into database

according to

"CDbCache stores cache data in a DB table named cacheTableName. If the table does not exist, it will be automatically created. By setting autoCreateCacheTable to false, you can also manually create the DB table"

I didn’t set another parameter for cache, I have already set database connection with the ‘db’ => array(…)

I was expected to see the cacheTableName table created into my database but nothing! the CDBCache still creates the file cache-1.1.12.db, What I do wrong?


Dear konapaz

We have to set the connectionId property. Otherwise Yii is going to create SQLite3 database in runtime directory.

It should be like






Thanks for reply Seenivasan :)

I will try and I will tell you if everything is ok.

It was so simple

it works! thanks :)