Page 1 of 1

Need help on db upgrade

Posted: Fri Oct 25, 2024 2:14 am
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:~$

Re: Need help on db upgrade

Posted: Wed Nov 13, 2024 3:05 am
by GadgetChris
I just ran into this same issue.
Not sure how to tackle this error :?:

Re: Need help on db upgrade

Posted: Wed Nov 13, 2024 9:01 am
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

Re: Need help on db upgrade

Posted: Wed Nov 20, 2024 2:55 pm
by kourier
executing SQL
truncate Monitor_Status;

fixed me too.. THANKS!!

Re: Need help on db upgrade

Posted: Fri Dec 06, 2024 6:55 am
by djtracer
Same with me, this worked....
truncate Monitor_Status;

Re: Need help on db upgrade

Posted: Tue Mar 25, 2025 3:49 pm
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.