ZoneMinder DB table Config Corrupted
Post date: Dec 1, 2012 1:04:51 AM
This has happened two times now. At least the second time I had a DB backup so instead of re-initializing the config table I re-loaded it.
First check if your disk is out of space.
These are the steps to recover...
steps to re-create CONFIG table
Make a copy of the
sql file and delete everything except the following sections:
- The line near the top that says "USE 'zm';"
- The section just below that has a "DROP TABLE" and "CREATE TABLE" applied to the "Config" table. This is 17 lines in my version of the sql file.
- The section that is about 620 lines into the file and starts with "delete from Config;" and has many lines beginning with "insert into Config...". This goes to the end of the file and is nearly 300 lines for me.
You now have an sql file that modifies the zoneminder (zm) database by deleting the config table and recreating it, then it initialises the configuration options to default values. This means you will lose all your settings if you apply this sql file to the database. However as you are seeing this error you have probably already lost all your settings.
To apply the script to the database you can use a command something like the following:
cat modifiedscript.sql | mysql -u root -p
Before you do this, I would recommend that you first verify that your Config table is empty:
mysql -u root -p
select * from Config;
You should see "0 rows in set" if the Config table is empty (before you apply the sql script), or something like "218 rows in set" if it is full (after you apply the sql script).
My sql file is archived at /mnt/droboShare/media2/bak/zm/zm_recreateConfig.sql