ZoneMInder 1.34 Multi-Server Install Startup fails with error:
ubuntu zmpkg.pl[27803]: DBI connect('database=zm;host=192.168.5.102','zmuser',...) failed: Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection. at /usr/share/perl5/ZoneMinder/Database.pm line 110.
For this instillation I have used a Raspberry Pi 4B with 8Gb memory with a 2 TB SSD drive as the Database and Storage Server, and a Dell OptiPlexTM GX520 with 16Gb memory as the Remote ZoneMinder Server.
Following these instructions for Multi-Server Install:
Ref:
The excellent write up by knnniggett, knight-of-ni here (Think I'm right here):
https://wiki.zoneminder.com/Common_Issu ... _on_Ubuntu
http://zoneminder.readthedocs.io/en/sta ... erver.html
For the u2 (Database and Storage Server) of these instructions, I have used a
RPi with Ubuntu Server 20.04, Zoneminder 1.34.x with MySQL-Server version: 8.0.23-0ubuntu0.20.04.1 (Ubuntu)
The above error occurs after completing the steps for Database and Storage Server, ZoneMinder fails to start and exits with the above error:
Here is a more complete snippet of the error:
Feb 27 21:7:10 ubuntu systemd[1]: Starting ZoneMinder CCTV recording and surveillance system...
Feb 27 21:57:10 ubuntu zmpkg.pl[27801]: DBI connect('database=zm;host=192.168.5.102','zmuser',...) failed: Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection. at /usr/share/perl5/ZoneMinder/Database.pm line 110.
Feb 27 21:57:10 ubuntu zmpkg.pl[27801]: DBI connect('database=zm;host=192.168.5.102','zmuser',...) failed: Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection. at /usr/share/perl5/ZoneMinder/Database.pm line 110.
Feb 27 21:57:10 ubuntu zmpkg.pl[27801]: DBI connect('database=zm;host=192.168.5.102','zmuser',...) failed: Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection. at /usr/share/perl5/ZoneMinder/Database.pm line 110.
Feb 27 21:57:10 ubuntu zmpkg.pl[27801]: Can't call method "prepare_cached" on an undefined value at /usr/share/perl5/ZoneMinder/Config.pm line 96.
Feb 27 21:57:10 ubuntu zmpkg.pl[27801]: BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder/Config.pm line 147.
Feb 27 21:57:10 ubuntu zmpkg.pl[27801]: Compilation failed in require at /usr/share/perl5/ZoneMinder.pm line 33.
Feb 27 21:57:10 ubuntu zmpkg.pl[27801]: BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder.pm line 33.
Feb 27 21:57:10 ubuntu systemd[1]: zoneminder.service: Control process exited, code=exited, status=255/EXCEPTION
Feb 27 21:57:10 ubuntu systemd[1]: zoneminder.service: Failed with result 'exit-code'.
Feb 27 21:57:10 ubuntu systemd[1]: Failed to start ZoneMinder CCTV recording and surveillance system.
Feb 27 21:57:21 ubuntu systemd[1]: zoneminder.service: Scheduled restart job, restart counter is at 1.
Feb 27 21:57:21 ubuntu systemd[1]: Stopped ZoneMinder CCTV recording and surveillance system.
This error seems to be related to the fact that mysql 8 now uses Caching SHA-2 Pluggable Authentication for its default_authentication_plugin and not mysql_native_password as previous mysql versions did. This is probably a security upgrade. I don't know anything about mysql except for some limited reading on the subject. But while going through Multi-Server Install I see there is a problem with the mysql command syntax,
"Grant remote user access (Note: for additional remote servers add them using their IP address)
mysql -uroot -p -e "grant all on zm.* to 'zmuser'@192.168.50.2 identified by 'zmpass';"
I got this error,
sudo mysql -uroot -p -e "grant all on zm.* to 'zmuser'@192.168.5.102 identified by 'SunUP2D@y';"
Enter password:
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'identified by 'My New Password for zmuser'' at line 1
In this post it appears, viewtopic.php?f=39&t=28840, "zoneminder notwork with mysql8" mysql's caching_sha2_password plugin is to be set to default_authentication_plugin=mysql_native_password in my.cnf.
So my question is. Do I simply change the default_authentication_plugin=caching_sha2_password for MySQL 8.0 from default_authentication_plugin=caching_sha2_password to default_authentication_plugin=mysql_native_password. As suggested here, "Zoneminder 34.0.- 23- 1- 2020.pdf", https://wiki.zoneminder.com/File:Zonemi ... -_2020.pdf, and here "HOW TO INSTALL ZONEMINDER -master ON UBUNTU 19.10 (eoan), with mysql 8, https://bkjaya.wordpress.com/2020/01/23 ... h-mysql-8/ by running this command,
sed -i "15i default_authentication_plugin=mysql_native_password" /etc/mysql/my.cnf
I do not want to further foobar my install by trying something I think will work. So if I change the default_authentication_plugin to mysql_native_password in /etc/mysql/my.cnf, and restart mysql. Will I be able to restart zoneminder without these errors, and get on with the Zoneminder Multi-Server Install.
Thanks, I look forward to any helpful replies.
ZoneMInder 1.34 Start Up Failed error 'caching_sha2_password'
- bkjaya1952
- Posts: 282
- Joined: Sat Aug 25, 2018 3:24 pm
- Location: Sri Lanka
Re: ZoneMInder 1.34 Start Up Failed error 'caching_sha2_password'
In the latest msql 8 You don't have to set "default_authentication_plugin=mysql_native_password in my.cnf. " . Please try the procedure in the following link
https://bkjaya.wordpress.com/2020/11/16 ... cal-fossa/
The above example is for Zoneminder master. You can replace "sudo add-apt-repository ppa:iconnor/zoneminder-master" with " sudo add-apt-repository ppa:iconnor/zoneminder-1.34" for the stable version of Zoneminder
https://bkjaya.wordpress.com/2020/11/16 ... cal-fossa/
The above example is for Zoneminder master. You can replace "sudo add-apt-repository ppa:iconnor/zoneminder-master" with " sudo add-apt-repository ppa:iconnor/zoneminder-1.34" for the stable version of Zoneminder