Drupal problems during cache tables

71 views
asked Dec 8, 2013 in Website Builder by carebare (1,420 points)
Hi all
I am having many issues when I try to import cache tables using MySQL and command lineI usually download the code for any upgrade and then export from the database using mysqldump . I usually load the database via mysql command line. And to go live with my modified db I do the same thing in reverse. I usually have problems only with cache tables containing content that causes mysql to hang or crash.  Does anyone know how to get around this?
Any help is appreciated
Many thanks

2 Answers

0 like 0 dislike
answered Dec 8, 2013 by RalphK (5,800 points)
Try clearing the cache tables before your export them. You can also get dump using the drush sql dump. check this http://drupaltraining.stanford.edu/node/85)
or youcan try using the  backup_migrate module
0 like 0 dislike
answered Dec 8, 2013 by randy999 (4,520 points)
Try this code to create a list of the truncate commands .
SELECT DISTINCT concat("TRUNCATE TABLE ", YOUR_TABLE_NAME, ";") FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'DATABSE_NAME' AND YOU_TABLE_NAME LIKE "cache_%";
...