Hi-

Here's my problem. I installed drupal awhile ago and haven't had any problems thus far. then today i was doing a bunch of editing and was running into some problems with gallery 2. i got that installed but was having a lot of trouble with the g2 module. the last thing i did was enable the g2 filter under input types. then when i went back to the home page of my site i got an error message that read something like (i didn't copy it): Fatal error: can't find open file cache.myi query: SELECT data, created, headers FROM cache WHERE cid = 'variables' in /home/site/site.org/data/includes/database.mysql.inc on line 66.

I don't really know a lot about php mysql and did something rather dumb. i went to the the admin for the mysql database and deleted the cache table. then the error message changed to saying it can't find the cache table, so i made a new table named cache, but it's not at all set up so now the error message reads: Fatal error: Unknown column 'data' in 'field list' query: SELECT data, created, headers FROM cache WHERE cid = 'variables' in /home/site/site.org/data/includes/database.mysql.inc on line 66.

i'm wondering if anyone has any ideas on what to do from here to get the site back, or at least how to recreate the cache table, and also why this first error might have hapenned.

thanks!

Comments

Brian@brianpuccio.net’s picture

First, the next time you want to clear your cache, don't drop the table, empty it. Second, your post mentions that you use the 4.5.x series. The install mysql file has this for creation of the cache table:

--
-- Table structure for table 'cache'
--

CREATE TABLE cache (
  cid varchar(255) NOT NULL default '',
  data longtext,
  expire int(11) NOT NULL default '0',
  created int(11) NOT NULL default '0',
  headers text,
  PRIMARY KEY  (cid),
  INDEX expire (expire)
) TYPE=MyISAM;

Drop your current one and recreate the cache table this way.

sinmao’s picture

What about for Drupal 5? Is the only difference in the data column, where "longblob" is used instead of "longtext"? Thx.