I have noticed in mysql that cache_form.MYD table is 14GB. Why did it grow so big? Is it safe to empty it? and how can I avoid this happening in the future?


  • What version of Drupal? – mpdonadio Sep 15 '11 at 14:29
  • It is drupal 6.22 – alfish Sep 15 '11 at 17:31
  • this question duplicates "Cache Form table size is enormous" - drupal.stackexchange.com/a/260649/53059 - a question that is a little newer and has much more activity/information – Kay V Apr 26 '18 at 11:02

https://drupal.org/project/optimizedb - module that will solve your problem. He can clear the table cache_form by Cron, also perform optimization and more. Versions available for Drupal 6.7.


This is a known issue in Drupal 6 and 7 for that matter. It is not cleared when running cron. You can safely delete all rows that has expired.

DELETE FROM {cache_form} WHERE expire < now();

should do the trick.

  • 2
    Since it's a "known issue", do you have a link to the issue queue? – marcvangend Jun 3 '13 at 17:36
  • @marcvangend Search in Drupal with cache form table size, many have reported that this particular table takes more than a gig some times. – GoodSp33d Jun 3 '13 at 17:38
  • 1
    I know how searching works, and I know there are a many of pages all over the web about this and similar problems. But I'm not asking for many... my question is, if anyone has a link to a single issue where developers are actively working on solving this specific problem. – marcvangend Jun 3 '13 at 18:42
  • 1
    @marcvangend I didnt mean like that , please dont take it that way. I just thought that you are nt aware of this issue :) There was one issue which was active but I didnt see any positive outcomes from it, same issue is still there. – GoodSp33d Jun 3 '13 at 19:49
  • 1
    @marcvangend: Well, there is many issue tickets on this: drupal.org/project/issues/drupal?text=cache_form&status=All. I have created a module drupal.org/sandbox/roheim/2010918 yesterday to deal with it. If you need it for D6, tell me. And bugs, feature requests of course as normal. I hope to make this a full project after some people have used it a little. – roheim Jun 4 '13 at 7:53

I suspect that cron isn't running on your site. I am not 100% positive about that particular table, but other cache tables do get stale entries removed when cron runs.

If you need help setting up cron, peruse http://drupal.org/cron

  • Well, as I see the status report the cron is run 1 hour ago. – alfish Sep 15 '11 at 17:29
  • How old is your site? Forms API had a bug, but I thought it was fixed a while ago: drupal.org/node/230374 If you clear your cache manually, does that table still grow w/o bound? – mpdonadio Sep 15 '11 at 18:29
  • The site is quite old but all modules are up to date. I'll empty the table and will see. Thanks – alfish Sep 15 '11 at 21:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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