Zabbix – Corrupt Events Table fix

I had to re create my events table then drop the old from the DB to get round an issue with mysql crashing.

To do this i did the following

#mysql -p

use zabbix;
SET FOREIGN_KEY_CHECKS=0;

CREATE TABLE events_new LIKE events

INSERT INTO events_new SELECT * FROM events

ALTER TABLE events RENAME events_old
ALTER TABLE events_new RENAME events

DROP TABLE events_old

SET FOREIGN_KEY_CHECKS=1;

quit

Once you have done this run the following to check all tables are ok.

#mysqlcheck -u root -p –check –all-databases

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.