How do I solve the "table '.cache' doesn't exist" error? My friend's site shows the following error message:


  user warning: Table '.cache' doesn't exist


I am working with zero documentation pertaining to the previous person's work on the site; I'm not sure what has been mucked around with.

How can I fix this?
To recreate this table for Drupal 6, execute the follwing in a SQL tool:

delimiter $$

CREATE TABLE `cache` (
  `cid` varchar(255) NOT NULL DEFAULT '',
  `data` longblob,
  `expire` int(11) NOT NULL DEFAULT '0',
  `created` int(11) NOT NULL DEFAULT '0',
  `headers` text,
  `serialized` smallint(6) NOT NULL DEFAULT '0',
  PRIMARY KEY (`cid`),
  KEY `expire` (`expire`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8$$


You may need to adjust this if the rest of the database is MyISAM (someone should confirm the CREATE statememt; I converted all of my Drupal 6 sites to InnoDB).

For Drupal 7, use

delimiter $$

CREATE TABLE `cache` (
  `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...'$$


It is possible that the old webmaster DROPed this table thinking it would save space.  Drupal will mostly work with without this table.  Then try to clear caches from admin/config/development/performance  When you do this, you should get some exceptions from any other missing cache tables.