0

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?

2
  • 2
    Some are going to recommend this question be closed because it is too broad. I think that recovering a vandalized site in Drupal is an appropriate topic. So lets work to narrow the problem. Are all of the error messages about missing cache tables? Do you have a recent backup of the database? Is the site hosted on a provider or on your own servers?
    – Triskelion
    Aug 9, 2013 at 15:51
  • I've updated the title to be a bit more specific, and ask the relevant question. Aug 9, 2013 at 16:48

3 Answers 3

1

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.

0

The error message clearly points to a missing database table. Install a fresh (matching) version of Drupal on any environment, and copy over the database schema for the missing table(s) from the new install to existing site. If it's just the cache tables, you don't need to worry about any of the table data.

0

I think you need to look at your database (using phpMyAdmin or whatever tool is provided with your hosting service) and see if it isn't completely wiped. While your error only proves that the "cache" table is missing, that's probably the first table being queried by any given request and it's hard to think of a bug that would erase that table and leave the rest of the database intact.

All of which strongly implies deliberation. If you're extremely lucky, Mr. Ex-webmaster simply threw a wrench in the gearworks when he left by deleting a table that Drupal needs to function but doesn't contain any irreplaceable information. But if he went that far it would have been just as easy for him to adopt a scorched earth policy. In either case, I hope you have your database backed up somewhere.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.