Need help on db upgrade

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
weiypan_us
Posts: 1
Joined: Fri Oct 25, 2024 1:57 am

Need help on db upgrade

Post by weiypan_us »

Find error message in /var/log/zm/zmpkg.log
2024-10-24 16:02:52.088252 zmpkg[1100].ERR [main:184] [Version mismatch, system is version 1.36.35, database is 1.36.33, please run zmupdate.pl to update.]

blk161@zoneminder:~$ sudo /usr/bin/zmupdate.pl

Initiating database upgrade to version 1.36.35 from version 1.36.33

Do you wish to take a backup of your database prior to upgrading?
This may result in a large file in /var/tmp/zm if you have a lot of events.
Press 'y' for a backup or 'n' to continue : n

Upgrading database to version 1.36.35
Upgrading DB to 1.36.34 from 1.36.33
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1292 (22007) at line 11: Incorrect datetime value: '0000-00-00 00:00:00' for column 'UpdatedOn' at row 1
Output:
Command 'mysql -u'zmuser' -p'zmpass' -hlocalhost zm < /usr/share/zoneminder/db/zm_update-1.36.34.sql' exited with status: 1
blk161@zoneminder:~$
GadgetChris
Posts: 11
Joined: Wed Mar 13, 2024 3:31 am
Location: GTA, ON, Canada

Re: Need help on db upgrade

Post by GadgetChris »

I just ran into this same issue.
Not sure how to tackle this error :?:
zm-v1.36.33 in docker @ Ubuntu 22.04.4.LTS
Miam
Posts: 1
Joined: Thu Jun 14, 2018 4:49 pm

Re: Need help on db upgrade

Post by Miam »

If someone else comes from google to this post:
The solution from Github Issue #4180 worked for me:
Truncating the Monitor_Status table in mysql allows to complete the installation
kourier
Posts: 1
Joined: Wed Nov 20, 2024 2:54 pm

Re: Need help on db upgrade

Post by kourier »

executing SQL
truncate Monitor_Status;

fixed me too.. THANKS!!
djtracer
Posts: 5
Joined: Tue Mar 28, 2023 9:23 am

Re: Need help on db upgrade

Post by djtracer »

Same with me, this worked....
truncate Monitor_Status;
codesauce
Posts: 1
Joined: Tue Mar 25, 2025 3:39 pm

Re: Need help on db upgrade

Post by codesauce »

I was able to resolve this by performing the following steps as mentioned above on my Ubuntu server installation:

1. Launch MySQL console

Code: Select all

sudo MySQL
2. You should now be at a MySQL prompt.
3. List the database on your MySQL server to validate the ZM database exists

Code: Select all

show databases;
4. You should see a list of DB's, one should be named 'zm'.

Code: Select all

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
| zm                 |
+--------------------+

5 rows in set (0.02 sec) 
5. Select the ZM database

Code: Select all

use zm
6. You should see the confirmation 'database changed'
7. Execute truncate table command

Code: Select all

TRUNCATE TABLE Monitor_Status;
8. The truncate command should return a 'query ok' response.
9. Exit MySQL console

Code: Select all

exit
10. Retry the upgrade.
Post Reply