Cant clear cache: Table cache_rules doesn't exist I just did a clear cache in the browser and also in the terminal with "drush cc all" and I'm getting the following error. I'm not sure what to do next as I can't clear the cache on the site, but it seems like the site is working fine. I'm on Drupal 7.32.


  PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'phone_drup.cache_rules' doesn't exist: TRUNCATE {cache_rules} ; Array()
  
  in cache_clear_all() (line 167 of /home/phone/public_html/includes/cache.inc).
It's related to this: https://www.drupal.org/node/2160645#comment-9904817

it seems that this is a reoccurring problem for drupal 7 sites. I'm not sure why it happens but it seems the fix is to DROP the cache_rules table and then recreate it again. But sometimes it doesnt recreate the table as it might throw an error -1 on recreation. 

I went into the terminal and to the mysql console and did the following:

DROP TABLE cache_rules ;


FYI: I had to set the engine parameter to blackhole in order for it to work. Default it is innodb. I'm not sure what blackhole is for. Just copy and paste into the terminal:

CREATE TABLE IF NOT EXISTS `cache_rules` (
  `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=blackhole DEFAULT CHARSET=utf8 COMMENT='Cache table for the rules engine to store configured items.';