Database Upgrade Error 1.28.107 to 1.28.109

Forum for questions and support relating to the 1.28.x releases only.
Locked
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Database Upgrade Error 1.28.107 to 1.28.109

Post by bbunge »

I got an error when I ran /usr/bin/zmupdate.pl to upgrade my database.

Ubuntu 14.04-3 64 bit system

Upgrading database to version 1.28.109
Loading config from DB
Saving config to DB
DBD::mysql::db do failed: Access denied for user 'zmuser'@'localhost' to database 'zm' at /usr/share/perl5/ZoneMinder/ConfigAdmin.pm line 135, <STDIN> line 2.
Can't lock Config table: Access denied for user 'zmuser'@'localhost' to database 'zm' at /usr/bin/zmupdate.pl line 498.
Issuing rollback() due to DESTROY without explicit disconnect() of DBD::mysql::db handle database=zm;host=localhost at /usr/share/perl/5.18/Carp.pm line 100, <STDIN> line 2.

I got around the error by dropping the zm database and installing a fresh copy
DVB Hardware
Posts: 201
Joined: Thu Jan 01, 2015 5:12 pm
Location: Rhode Island

Re: Database Upgrade Error 1.28.107 to 1.28.109

Post by DVB Hardware »

I did too today, I think I went to phpmyadmin and the privileges were reduced for zmuser, so I edited it and applied all.

I also had a version mismatch error so I installed again uping .108 to .109. so after I fixed zmuser I ran zmupdate.pl

The best I can remember

Jimmy
Linux Mint 21 Cinnamon Mariadb 10.6.x using Master 1.37.x latest always

DVB stands for Digital VIdeo Broadcasting , retired satellite downlink supplier
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Database Upgrade Error 1.28.107 to 1.28.109

Post by knight-of-ni »

Can't lock Config table: Access denied for user 'zmuser'@'localhost' to database 'zm' at /usr/bin/zmupdate.pl line 498.
So either the Config table was open by some other process (did you stop zoneminder?)
or your zmuser account does not have mysql "lock" permission assigned to it.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Database Upgrade Error 1.28.107 to 1.28.109

Post by bbunge »

zm was stopped

lack of "lock" likely it

Should input?

mysql -e "grant select,insert,update,delete,create,lock on zm.* to 'zmuser'@localhost identified by 'zmpass';"


Will try again tomorrow.
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: Database Upgrade Error 1.28.107 to 1.28.109

Post by rockedge »

I got an error when I ran /usr/bin/zmupdate.pl to upgrade my database.
I ran into the same errors with the fix by ending up dropping the database and creating new. Upgrade 1.28.108 > 1.28.109
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Database Upgrade Error 1.28.107 to 1.28.109

Post by bbunge »

Upgrade worked the second time. MySQL permissions should be:

mysql -e "grant select,insert,update,delete,create,alter,lock tables on zm.* to 'zmuser'@localhost identified by 'zmpass';"

Upgrade procedures at:

https://wiki.zoneminder.com/Common_Issu ... _on_Ubuntu
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Database Upgrade Error 1.28.107 to 1.28.109

Post by knight-of-ni »

Bill,
As of 1.28.109, you need to add "index" to the set of mysql permissions.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Database Upgrade Error 1.28.107 to 1.28.109

Post by bbunge »

Will go back and try it again.....

bb
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Database Upgrade Error 1.28.107 to 1.28.109

Post by bbunge »

2nd test upgrade. I needed the lock tables and alter to get the database upgrade to work. So, with index added the command is:

mysql -e "grant select,insert,update,delete,create,alter,lock tables,index on zm.* to 'zmuser'@localhost identified by 'zmpass';"
Locked