Hello,
after a reboot, zoneminder did not record any events anymore. I found this in the logs:
Sep 29 15:37:39 linux zma-m2[6720]: INF [Tresen: 029 - Gone into alarm state]
Sep 29 15:37:39 linux zma-m2[6720]: ERR [Can't insert event: Duplicate entry '38689' for key 1]
I had this problem once before. At that time I deleted all entries in the database, but there must be a different solution for this problem, or?
Greetings from germany,
Hermi
Can't insert event
It sounds like your database has crashed and now has inconsistancies in it.
You'll want to shut down your database cleanly with either:
mysqladmin -u root -p shutdown
or if you can't do that for some reason:
kill -TERM <pid of mysql>
and if that still doesn't cause it to stop (corruption sometimes causes mysql to not die as it should), then:
kill -KILL <pid of mysql>
Now that mysql isn't running, you need to go into the directory that contains your database files, perhaps /var/lib/mysql/zm or wherever your distribution keeps them, and do:
myisamchk -o *.MYI
this will rebuild the indexes to all your tables.
Now start up mysqld again (/etc/init.d/mysql start or whatever) and you should be good to go.
You'll want to shut down your database cleanly with either:
mysqladmin -u root -p shutdown
or if you can't do that for some reason:
kill -TERM <pid of mysql>
and if that still doesn't cause it to stop (corruption sometimes causes mysql to not die as it should), then:
kill -KILL <pid of mysql>
Now that mysql isn't running, you need to go into the directory that contains your database files, perhaps /var/lib/mysql/zm or wherever your distribution keeps them, and do:
myisamchk -o *.MYI
this will rebuild the indexes to all your tables.
Now start up mysqld again (/etc/init.d/mysql start or whatever) and you should be good to go.
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
mysqlcheck is similar in function to myisamchk, but works differently. The main operational difference is that mysqlcheck must be used when the mysqld server is running, whereas myisamchk should be used when it is not. The benefit of using mysqlcheck is that you do not have to stop the server to check or repair your tables.
from http://dev.mysql.com/doc/mysql/en/Using_mysqlcheck.html
from http://dev.mysql.com/doc/mysql/en/Using_mysqlcheck.html
Fernando