
I have a previous post wherein I went through a full recovery of one of my MySQL databases because I’d had a power failure and it caused some corruption in one of my redo logs, post is here https://www.lukky.us/recover-mysql-instance-after-power-failure/
As a result of that same power outage, my Zabbix database instance became corrupted as well. I repeated the process that I’d used in that previous article to recover my Zabbix database, but one thing that happened as a result of that recovery is an error message ‘table zabbix history_uint doesn’t exist in engine’ in the web interface when visiting some of the pages. I listed all tables in the recovered database and it was correct, history_uint did not exist. After a bit of searching around I was able to find the specifics of creating that table and recreated it using the following command:
CREATE TABLE history_uint (
itemid bigint unsigned NOT NULL,
clock integer DEFAULT '0' NOT NULL,
value bigint unsigned DEFAULT '0' NOT NULL,
ns integer DEFAULT '0' NOT NULL,
PRIMARY KEY (itemid, clock, ns)
) ENGINE=InnoDB;
After recreating this table, I got the error ‘table zabbix trends_uint doesn’t exist in engine’ in a similar way so I recreated that table as well, again using the following command (again found online, not created by me):
CREATE TABLE trends_uint (
itemid BIGINT UNSIGNED NOT NULL,
clock INTEGER DEFAULT '0' NOT NULL,
num INTEGER DEFAULT '0' NOT NULL,
value_min BIGINT UNSIGNED DEFAULT '0' NOT NULL,
value_avg BIGINT UNSIGNED DEFAULT '0' NOT NULL,
value_max BIGINT UNSIGNED DEFAULT '0' NOT NULL,
PRIMARY KEY (itemid, clock)
) ENGINE=InnoDB;
I’m guessing that both of these tables were corrupted and when I did the mysqldump –skip-lock-tables they were not able to be read, in which case they were skipped and not recreated once I imported the dump file. Keep in mind that recreating these tables does mean that all of the data is gone, but if that’s not a huge issue for you, this should get you back up and running again.
I ended up getting both of these commands from Brave Search Quick answer, but I believe where it pulled the data from is this forum post in Russian https://www.zabbix.com/forum/in-russian/427458-table-zabbix-history_uint-doesn-t-exist-in-engine in case you’re curious to find out the real source of the command to recreate these tables.
Leave a Reply