Reset events and frames ID number

Support and queries relating to all previous versions of ZoneMinder
Locked
gola10
Posts: 150
Joined: Wed Nov 01, 2006 3:16 pm
Location: Panama

Reset events and frames ID number

Post by gola10 »

I have ZM 1.22.3 installed from ZM Mandriva 2007 livecd. This computer was attacked by a hacker so i better reinstall. But i want to keep y settings.
One way to go is to backup the database and restore it on the new installation. (at least that i what i plan. But would like to reset reset frame ID number and Events ID number. Frames number is already 8 digits and events 6 digits.
Is there a script to reset this databases and the autoincrement field?
User avatar
Lee Sharp
Posts: 1069
Joined: Sat Mar 31, 2007 9:18 pm
Location: Houston, TX

Post by Lee Sharp »

Start here. http://www.zoneminder.com/forums/viewtopic.php?t=11005 However, changing things can add some different problems. Be careful.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Although you can reset the events and frame indexes etc this will only work if you do not have entries in the DB already. If you add even just one event with an id of 1000000 then the next one will be 10000001 regardless. If you have an empty DB you can reset the counts with

Code: Select all

alter table Events auto_increment=1;
etc.
Phil
Alan87i
Posts: 116
Joined: Sun Jul 27, 2008 9:58 am

A bit more detail

Post by Alan87i »

Could someone please explain a little further where or what a fellow is to do with this code ( alter table Events auto_increment=1 ) to make use of it?
Thanks
MikeH
Posts: 23
Joined: Tue Jul 22, 2008 5:16 pm
Location: UK

Post by MikeH »

It's a SQL statement that could be run against the ZM database using phpMyAdmin or some similar tool.
Locked