I'm updating Drupal but the caches won't clear because of the following error:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table
'interpca_drupalc2.drupal_cache_filter' doesn't exist: TRUNCATE {cache_filter} ;
Array ( ) in cache_clear_all() (line 167 of
/home/interpca/public_html/includes/cache.inc).

I've checked in phpMyAdmin and the table is listed in the sidebar but not when
the tables are listed in the main window when the database itself is selected.

I've tried to recreate the table with the following:

CREATE TABLE `drupal_cache_filter` (
 `cid` varchar(255) NOT NULL DEFAULT '' COMMENT 'Primary Key: Unique cache
ID.',
 `data` longblob COMMENT 'A collection of data to cache.',
 `expire` int(11) NOT NULL DEFAULT '0' COMMENT 'A Unix timestamp indicating when
the cache entry should expire, or 0 for never.',
 `created` int(11) NOT NULL DEFAULT '0' COMMENT 'A Unix timestamp indicating
when the cache entry was created.',
 `serialized` smallint(6) NOT NULL DEFAULT '0' COMMENT 'A flag to indicate
whether content is serialized (1) or not (0).',
 PRIMARY KEY (`cid`),
 KEY `expire` (`expire`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Generic cache table for caching
things not separated out...'

But only get an error that says:

" #1146 - Table 'interpca_drupalc2.drupal_cache_filter' doesn't
exist"

(Of course it doesn't exist, which is why I'm trying to CREATE it.)

I'm not a mySQL expert, so maybe I'm missing something obvious, but the fact
that it's listed in the sidebar list but not in the main list suggests to me
something is funky.

Also, when tried to backup the database, below error was showing;
+++++++++++
mysqldump: Got error: 1146: Table 'interpca_drupalc2.drupal_cache_filter'
doesn't exist when using LOCK TABLES
+++++++++++

But mysql 'show tables' command shown the above table. I have dropped the table
manually, and tried again to CREATE, but no success.

Any help is appreciated so I can get the site back online...

Comments

resmonde’s picture

Hi,

I too am no DB expert but I had the same issue after upgrading D7 from v7.24 to latest. I was dead in the water so I did a DROP table first on cache_filter. Then I imported the table in from another Drupal 7 install so that everything would be just as Drupal needed. Then I got a similar error about cache_views. So, I dropped it as well and imported its structure from the same sibling D7 DB and now everything works. If you do not have a sibling DB to import from maybe download another D7 install and use its cache tables (views and filter), otherwise using the SQL you are trying to use should work after the drops.

Hope this helps