0

On my Drupal site, I have about 100 nodes that need deleting. I have deleted them via Views Bulk Operations.

When I do this, if I make a backup of my site MySQL database and then try to restore it via PHP My Admin, I get the following error:

INSERT INTO `cache_form` (`cid`, `data`, `expire`, `created`, `serialized`) VALUES
('form_state_form-0ry4vXadnLIroZBOuRNpM4WJWgNm0HNVumQ1bNHLEu4', 0x613a363a7b733a31303a226275696c645f696e666f223b613a333a7b733a343a2261726773223b613a323a7b693a303b4f3a343a2276696577223a35363a7b733a383a2264625f7461626c65223b733a31303a2276696577735f76696577223b733a31303a22626173655f7461626c65223b733a343a226e6f6465223b733a31303a22626173655f6669656c64223b733a333a226e6964223b733a343a226e616d65223b733a31313a2262756c6b5f64656c657465223b733a333a22766964223b733a313a2236223b733a31313a226465736372697074696f6e223b733a303a22223b733a333a22746167223b733a373a2264656661756c74223b733a31303a2268756d616e5f6e616d65223b733a31313a2242756c6b2044656c657465223b733a343a22636f7265223b733a313a2237223b733a31313a226170695f76657273696f6e223b4e3b733a383a2264697361626c6564223b4e3b733a373a2265646974696e67223b623a303b733a343a2261726773223b613a303a7b7d733a383a227573655f616a6178223b623a303b733a363a22726573756c74223b613a3130303a7b693a303b4f3a3[...]
MySQL said: Documentation

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 2 

The error has been caused by deleting the nodes. If I go to an earlier back-up before the nodes were deleted, it works fine. However, everytime I delete the nodes, this error comes back.

How can I delete the nodes without the database becoming corrupt. I clear the cache after deletion and before backing up, but the problem still occurs.

Interestingly after deleting nodes, the size of the databse jumps from 16MB to 80MB. So I am not sure if the deletion is putting some bad data in the database.

0

You need to increase max_allowed_packets in my.cnf file. to insert big data from cache tables. The best practice to avoid this is, never export cache prefixed tables data.

| improve this answer | |
  • I don't understand. Where is my.cnf file? Is it in Drupal? Also, how does it relate to deleting nodes? – big_smile Mar 3 '15 at 13:00
  • It is a mysql setting. You need server's root access to the same. This solution is for error you are getting while backing up the database. – Vishal Patil Mar 3 '15 at 13:02
  • I have already done this, but have the problem. I don't think the issue is with PhpMyAdmin. The issue is to do with deleting the nodes which "damages" the database. – big_smile Mar 3 '15 at 13:22
  • No, it's your backup containing a long record that is the problem. Deleting the nodes has nothing to do with it, except that as a side effect it creates a large form cache entry. – Alfred Armstrong Mar 3 '15 at 14:39
0

When you delete a lot of Nodes in Drupal, the cache_form table in the database becomes very large. You need to empty this before making a backup.

Steps:

  1. Go to PHPMyAdmin and open your Database
  2. Click on structure.
  3. Look for the row "cache_form:
  4. Look at the MB value for the row. If it is a big value, that's the problem.
  5. Click on Empty.

Now you can back up your database and can then be restored.

| improve this answer | |

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.