Accidentally deleted /var/lib/mysql/zm/Logs.ibd

Forum for questions and support relating to the 1.34.x releases only.
Post Reply
elk0
Posts: 3
Joined: Fri Feb 12, 2021 6:08 pm

Accidentally deleted /var/lib/mysql/zm/Logs.ibd

Post by elk0 »

Hello,
I just accidentally deleted the following file /var/lib/mysql/zm/Logs.ibd which was 2.7GB in size. Unfortunately I don't have a backup.
Was there anything system specific in the file or could I somehow replace the file? I don't really want to to uninstall zoneminder and reinstall it from scratch.
Thanks for ideas
elk0
Posts: 3
Joined: Fri Feb 12, 2021 6:08 pm

Re: Accidentally deleted /var/lib/mysql/zm/Logs.ibd

Post by elk0 »

Nobody? :cry:
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: Accidentally deleted /var/lib/mysql/zm/Logs.ibd

Post by Magic919 »

It’s a database problem. You’ve deleted the binary logs by the sounds of it. There must be a lot better places to get a response.
-
jperkins
Posts: 50
Joined: Sat Jan 23, 2021 11:08 am

Re: Accidentally deleted /var/lib/mysql/zm/Logs.ibd

Post by jperkins »

just a wild ass guess but this may be a place for you to start figuring out how to recreate the database table 'Logs'

https://github.com/ZoneMinder/zoneminde ... ql.in#L365
User avatar
kitkat
Posts: 193
Joined: Sun Jan 27, 2019 5:17 pm

Re: Accidentally deleted /var/lib/mysql/zm/Logs.ibd

Post by kitkat »

To recreate the table:

- open a SQL prompt,
- select your ZM database,
- paste this:

Code: Select all

CREATE TABLE `Logs` (
 `ID` int(11) NOT NULL AUTO_INCREMENT,
 `TimeKey` decimal(16,6) NOT NULL,
 `Component` varchar(32) NOT NULL,
 `ServerId` int(10) unsigned DEFAULT NULL,
 `Pid` int(10) DEFAULT NULL,
 `Level` tinyint(3) NOT NULL,
 `Code` char(3) NOT NULL,
 `Message` text NOT NULL,
 `File` varchar(255) DEFAULT NULL,
 `Line` smallint(5) unsigned DEFAULT NULL,
 PRIMARY KEY (`ID`),
 KEY `TimeKey` (`TimeKey`),
 KEY `Logs_TimeKey_idx` (`TimeKey`),
 KEY `Logs_Level_idx` (`Level`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
That's for ZM version 1.34.23 - Other versions may be different.
elk0
Posts: 3
Joined: Fri Feb 12, 2021 6:08 pm

Re: Accidentally deleted /var/lib/mysql/zm/Logs.ibd

Post by elk0 »

Thanks for the answers.
Unfortunately, it doesn't work to create the “Logs” table.
If I delete the table “Logs” first, then create the new one, it still tells me that it already exists, picture attached.
Unfortunately, I don't know exactly which version I have, in which table can I look it up?
Attachments
zm logs.PNG
zm logs.PNG (28.63 KiB) Viewed 1241 times
Post Reply