ZM using 'root' to write to MYSQL

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
neilb
Posts: 1
Joined: Mon Apr 17, 2023 8:20 am

ZM using 'root' to write to MYSQL

Post by neilb »

ZoneMinder 1.36.12

I have a working installation of ZoneMinder with 3 camera working and MYSQL running in which I can see that 'amuser' has been writing entries.

For security, I have disabled the MYSQL user 'root'

When I try to create new zones via the web interface I note that the settings do not save. I have the following error appear in web_php.log

Code: Select all

04/17/23 09:03:27.202616 web_php[288738].ERR [192.168.1.187] [SQL-ERR 'SQLSTATE[HY000]: General error: 1449 The user specified as a definer ('root'@'localhost') does not exist', statement was 'INSERT INTO Zones SET MonitorId=?, `NumCoords` = '4', `Coords` = '0,0 1279,0 1279,719 0,719', `Area` = '921600', `AlarmRGB` = '16711680', `Name` = 'New', `Type` = 'Active', `Units` = 'Percent', `CheckMethod` = 'AlarmedPixels', `MinPixelThreshold` = '40', `MaxPixelThreshold` = NULL, `MinAlarmPixels` = '92160', `MaxAlarmPixels` = NULL, OverloadFrames = 0' params:1] at /usr/share/zoneminder/www/includes/database.php line 161
My question: Should ZM be trying to use a root logging to write to the ZM database? (I would prefer not given that 'amuser' exists for this purpose); and, how can I change this behaviour?

With thanks

Neil
166MHz
Posts: 3
Joined: Sun Apr 16, 2023 2:42 am

Re: ZM using 'root' to write to MYSQL

Post by 166MHz »

in /etc/zm , add read rights to web server user (www-data i think ) for file zm.conf and /etc/zm/conf.d/* too
Post Reply