Zoneminder fails to start - mysql error

Forum for questions and support relating to the 1.34.x releases only.
Post Reply
uhsa
Posts: 3
Joined: Thu Oct 01, 2020 1:10 pm

Zoneminder fails to start - mysql error

Post by uhsa »

Hello
I just installed a fresh copy of zoneminder 1.34.20 on centos 7

However, I was unable to go to http://IP.address/zm - there was nothing there.

Looking more into it - i see this problem:

Code: Select all

Oct 05 10:44:23 server1 zmpkg.pl[11891]: DBI connect('database=zm;host=localhost','zmuser',...) failed: Access denied for user 'zmuser'@'localhost' (using password: YES) at /usr/share/perl5/vendor_perl/ZoneMinder/Database.pm line 107.
Oct 05 10:44:23 server1 zmpkg.pl[11891]: DBI connect('database=zm;host=localhost','zmuser',...) failed: Access denied for user 'zmuser'@'localhost' (using password: YES) at /usr/share/perl5/vendor_perl/ZoneMinder/Database.pm line 107.
Oct 05 10:44:23 server1 zmpkg[11891]: ERR [Error reconnecting to db: errstr:Access denied for user 'zmuser'@'localhost' (using password: YES) error val:]
Oct 05 10:44:23 server1 zmpkg.pl[11891]: DBI connect('database=zm;host=localhost','zmuser',...) failed: Access denied for user 'zmuser'@'localhost' (using password: YES) at /usr/share/perl5/vendor_perl/ZoneMinder/Database.pm line 107.
Oct 05 10:44:23 server1 zmpkg[11891]: ERR [Error reconnecting to db: errstr:Access denied for user 'zmuser'@'localhost' (using password: YES) error val:]
Oct 05 10:44:23 server1 zmpkg.pl[11891]: Can't call method "prepare_cached" on an undefined value at /usr/share/perl5/vendor_perl/ZoneMinder/Config.pm line 96.
Oct 05 10:44:23 server1 zmpkg.pl[11891]: BEGIN failed--compilation aborted at /usr/share/perl5/vendor_perl/ZoneMinder/Config.pm line 147.
Oct 05 10:44:23 server1 zmpkg.pl[11891]: Compilation failed in require at /usr/share/perl5/vendor_perl/ZoneMinder.pm line 33.
Oct 05 10:44:23 server1 zmpkg.pl[11891]: BEGIN failed--compilation aborted at /usr/share/perl5/vendor_perl/ZoneMinder.pm line 33.
Oct 05 10:44:23 server1 zmpkg.pl[11891]: Compilation failed in require at /usr/bin/zmpkg.pl line 34.
Oct 05 10:44:23 server1 zmpkg.pl[11891]: BEGIN failed--compilation aborted at /usr/bin/zmpkg.pl line 34.
Oct 05 10:44:23 server1 systemd[1]: zoneminder.service: control process exited, code=exited status=255
Oct 05 10:44:23 server1 systemd[1]: Failed to start ZoneMinder CCTV recording and security system.
-- Subject: Unit zoneminder.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit zoneminder.service has failed.
-- 
-- The result is failed.
Oct 05 10:44:23 server1 systemd[1]: Unit zoneminder.service entered failed state.
Oct 05 10:44:23 server1 systemd[1]: zoneminder.service failed.
Oct 05 10:44:23 server1 sudo[11884]: pam_unix(sudo:session): session closed for user root
Oct 05 10:44:23 server1 polkitd[658]: Unregistered Authentication Agent for unix-process:11885:438794 (system bus name :1.379, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)
Oct 05 10:44:38 server1 xrdp[3615]: (3615)(140160907733440)[DEBUG] VNC got clip data
Oct 05 10:44:38 server1 xrdp[3615]: (3615)(140160907733440)[DEBUG] CLIPRDR_FORMAT_ACK - status 1 length 0
Oct 05 10:44:42 server1 xrdp[3615]: (3615)(140160907733440)[DEBUG] VNC got clip data
Oct 05 10:44:42 server1 xrdp[3615]: (3615)(140160907733440)[DEBUG] CLIPRDR_FORMAT_ACK - status 1 length 0
Oct 05 10:44:51 server1 systemd[1]: sshd.service holdoff time over, scheduling restart.
Oct 05 10:44:51 server1 systemd[1]: Stopped OpenSSH server daemon.
-- Subject: Unit sshd.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
I am not sure what to do here - i checked by doing mysql -uzmuser -p and I can get into it fine. It has been given the following:

Code: Select all

grant all privileges on zm.* to 'zmuser'@'localhost' with grant option;
So I am at a loss why journalctl -xe would show "Access denied for user zmuser"

Can someone please help?
User avatar
burger
Posts: 443
Joined: Mon May 11, 2020 4:32 pm

Re: Zoneminder fails to start - mysql error

Post by burger »

If the web server is not showing the webpage, that may mean apache isn't configured correctly. Did you enable the zoneminder config? It may not be necessary with the latest install scripts, but if they failed for some reason, it can be done manually. Enabling config is often a2enconf zoneminder. Website is in /usr/share/zoneminder/www. Apache should serve this.

If you are new to ZM and GNU\Linux, It may be easier to use the Ubuntu / Debian guides on the wiki. https://wiki.zoneminder.com/Ubuntu
https://wiki.zoneminder.com/Debian

Mysql should work with ZM. if you can login to it manually. Username and pass for mysql are stored in a config, /etc/zm/zm.conf. Default user/pass is zmuser/zmpass.

EDIT: Please don't post multiple times. viewtopic.php?f=40&t=30023
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
Post Reply