New Install with DB on remote host - debian-sys-maint

Previous development branch now released as 1.36
Locked
zxarr
Posts: 7
Joined: Mon Apr 22, 2019 2:56 pm

New Install with DB on remote host - debian-sys-maint

Post by zxarr »

I just installed zoneminder 1.35.16 on Ubuntu 20.04, without any issues, it seemed. Once installed, I migrated the newly created DB to a mysql VM where I keep most DB's. Zoneminder starts, I can add cameras, etc... but when I try to create a zone, nothing happens. The log states:

Code: Select all

Can't insert event: The user specified as a definer ('debian-sys-maint'@'localhost') does not exist. sql was (INSERT INTO Events ( MonitorId, StorageId, Name, StartDateTime, Width, Height, Cause, Notes, StateId, Orientation, Videoed, DefaultVideo, SaveJPEGs, Scheme ) VALUES ( 1, 2, 'New Event', from_unixtime( 1608431738 ), 2560, 1440, 'Continuous', '', 1, 1, 0, '', 3, 'Medium' ))  zm_event.cpp	line 111
I no longer have a mysql server on the zoneminder host, so I'm not really sure where zoneminder is getting this user from, aside from /etc/mysql/debian.cnf. Why would zoneminder be ignoring the zm.conf file for some DB calls?

I'm assuming I copied something over with the DB that includes this user, for whatever reason, so I did some searching and learned that some table views have a definer. If this is the issue, how do I find out? I tried a few commands I'd found online, but they listed 0 views in the DB.

Not sure where to go next. Any help would be appreciated.
bbunge
Posts: 2967
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: New Install with DB on remote host - debian-sys-maint

Post by bbunge »

nano /etc/zm/zm.conf

ZM_DB_HOST=192.168.50.2

Make sure the ZM User has the right password and permissions on the remote database server.
zxarr
Posts: 7
Joined: Mon Apr 22, 2019 2:56 pm

Re: New Install with DB on remote host - debian-sys-maint

Post by zxarr »

bbunge wrote: Sun Dec 20, 2020 4:45 pm nano /etc/zm/zm.conf

ZM_DB_HOST=192.168.50.2

Make sure the ZM User has the right password and permissions on the remote database server.
I set up this additional storage in the ZM gui and it appears in the database:
Image

Code: Select all

ZM_DB_HOST=mysql
# ZoneMinder database name
ZM_DB_NAME=zm
# ZoneMinder database user
ZM_DB_USER=zm
# ZoneMinder database password
ZM_DB_PASS=*************
And lastly, the zm mysql user has All Privileges with Grant on the zm DB.

It almost seems that somewhere in zoneminder the debian-sys-maint@localhost user is hard-coded. Even if I granted access in the remote DB, it would fail, as it's attempting to connect to localhost, instead of the 'mysql' server.
zxarr
Posts: 7
Joined: Mon Apr 22, 2019 2:56 pm

Re: New Install with DB on remote host - debian-sys-maint

Post by zxarr »

So I discovered a workaround.

I created a debian-sys-maint user on my remote database, with the password from my zoneminder system's /etc/mysql/debian.cnf.

This is still an issue, why would zoneminder be ignoring what's set in zm.conf?
rockedge
Posts: 1199
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: New Install with DB on remote host - debian-sys-maint

Post by rockedge »

zxarr wrote:why would zoneminder be ignoring what's set in zm.conf?
Are there any config files in /etc/zm/conf.d that are overriding the zm.conf? If so the configurations in /etc/zm/conf.d/*.conf will override the zm.conf by design.

Something like "zmcustom.conf" or "any-name.conf" will be the culprit if this is the case.
Locked