Installation : [2054] The server requested authentication method unknown to the client

Forum for questions and support relating to the 1.32.x releases only.
Post Reply
instantdreams
Posts: 5
Joined: Wed Nov 20, 2019 7:38 pm

Installation : [2054] The server requested authentication method unknown to the client

Post by instantdreams » Wed Nov 20, 2019 8:07 pm

Here is my server details:
  • Ubuntu 19.10 Server
  • Apache 2.4.41
  • MySQL 8.0.18
  • PHP 7.3.11
Here are my installation steps:
1. Ensure all software is up to date
  • sudo apt-get update
  • sudo apt-get upgrade
2. Configure server
  • timedatectl set-timezone 'America/Edmonton'
3. Install LAMP
  • sudo apt install tasksel
  • sudo tasksel install lamp-server
4. Configure MySQL
  • sudo nano /etc/mysql/my.cnf

    Code: Select all

    	[mysqld]
    	sql_mode = NO_ENGINE_SUBSTITUTION
  • sudo service mysql restart
5. Install Zoneminder
  • sudo add-apt-repository ppa:iconnor/zoneminder-1.32
  • sudo apt-get update
  • sudo apt-get upgrade
  • sudo apt-get install zoneminder
5. Configure Zoneminder
  • sudo chmod 740 /etc/zm/zm.conf
  • sudo chown root:www-data /etc/zm/zm.conf
  • sudo chown -R www-data:www-data /usr/share/zoneminder/
  • sudo mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql
  • sudo mysql -uroot -p -e "CREATE USER 'zmuser'@'localhost' IDENTIFIED BY 'zmpass';"
  • sudo mysql -uroot -p -e "GRANT ALL ON zm.* TO 'zmuser'@localhost;"
  • sudo mysqladmin -uroot -p reload
6. Configure apache
  • sudo nano /etc/apache2/apache2.conf

    Code: Select all

    	KeepAlive On
    	MaxKeepAliveRequests 50
    	KeepAliveTimeout 5
  • sudo nano /etc/apache2/mods-available/mpm_prefork.conf

    Code: Select all

    	<IfModule mpm_prefork_module>
    			StartServers            4
    			MinSpareServers         3
    			MaxSpareServers         40
    			MaxRequestWorkers       200
    			MaxConnectionsPerChild  10000
    	</IfModule>
  • sudo a2enmod cgi
  • sudo a2enmod rewrite
  • sudo a2enconf zoneminder
  • sudo a2enmod expires
  • sudo a2enmod headers
  • sudo service apache2 restart
7. Start Zoneminder
  • sudo service zoneminder start
15. Test
  • hostname
  • hostname -I
  • http://[hostname]/zm/

Here are the results:

Code: Select all

Unable to connect to ZM db.SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client

Apparently this is because mySQL 8 uses a different method of authentication by default. Any ideas how to fix this?

instantdreams
Posts: 5
Joined: Wed Nov 20, 2019 7:38 pm

Re: Installation : [2054] The server requested authentication method unknown to the client

Post by instantdreams » Wed Nov 27, 2019 6:44 pm

My issue is the disjointed documentation - does anyone have any direction?

instantdreams
Posts: 5
Joined: Wed Nov 20, 2019 7:38 pm

Re: Installation : [2054] The server requested authentication method unknown to the client

Post by instantdreams » Fri Dec 20, 2019 6:06 pm

Anyone have any tips?

User avatar
snake
Posts: 334
Joined: Sat May 21, 2016 2:20 am

Re: Installation : [2054] The server requested authentication method unknown to the client

Post by snake » Fri Dec 20, 2019 7:00 pm

Use MariaDB.

There may be php errors. I think 19.10 is not ready for ZM yet.

User avatar
bkjaya1952
Posts: 35
Joined: Sat Aug 25, 2018 3:24 pm
Location: Sri Lanka
Contact:

Re: Installation : [2054] The server requested authentication method unknown to the client

Post by bkjaya1952 » Thu Jan 02, 2020 12:59 pm

I also have the same problem.
I have used following steps to create zm database on mysql 8
gedit /etc/mysql/my.cnf
And added the following line below line number 32 (bind address) and save my.cnf
default-authentication-plugin=mysql_native_password



mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql
mysql -uroot -p -e CREATE USER 'zmuser'@localhost IDENTIFIED WITH mysql_native_password BY 'zmpass';
mysql GRANT ALL PRIVILEGES ON zm.* TO 'zmuser'@'localhost' WITH GRANT OPTION;
mysql flush privileges;
systemctl restart mysql
mysqladmin -uroot -p reload


# service zoneminder status

● zoneminder.service - ZoneMinder CCTV recording and surveillance system
Loaded: loaded (/lib/systemd/system/zoneminder.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2020-01-02 16:39:56 +0530; 1h 47min ago
Main PID: 1612 (zmdc.pl)
Tasks: 6 (limit: 4915)
Memory: 120.4M
CGroup: /system.slice/zoneminder.service
├─1612 /usr/bin/perl -wT /usr/bin/zmdc.pl startup
├─1647 /usr/bin/perl -wT /usr/bin/zmfilter.pl --filter_id=1 --daemon
├─1655 /usr/bin/perl -wT /usr/bin/zmfilter.pl --filter_id=2 --daemon
├─1660 /usr/bin/perl -wT /usr/bin/zmwatch.pl
├─1668 /usr/bin/perl -wT /usr/bin/zmupdate.pl -c
└─1674 /usr/bin/perl -wT /usr/bin/zmstats.pl

ජන 02 16:39:55 bandula sudo[1671]: pam_unix(sudo:session): session opened for user www-data by (uid=0)
ජන 02 16:39:55 bandula zmdc[1612]: INF ['zmstats.pl' starting at 20/01/02 16:39:55, pid = 1674]
ජන 02 16:39:55 bandula zmdc[1674]: INF ['zmstats.pl' started at 20/01/02 16:39:55]
ජන 02 16:39:56 bandula sudo[1671]: pam_unix(sudo:session): session closed for user www-data
ජන 02 16:39:56 bandula systemd[1]: Started ZoneMinder CCTV recording and surveillance system.
ජන 02 16:39:56 bandula zmstats[1674]: INF [Stats Daemon starting in 30 seconds]
ජන 02 16:39:57 bandula zmfilter_2[1655]: INF [Scanning for events using filter id '2']
ජන 02 16:39:57 bandula zmfilter_1[1647]: INF [Scanning for events using filter id '1']
ජන 02 16:54:16 bandula zmwatch[1660]: ERR [Error reconnecting to db: errstr:Can't connect to local MySQL server through socket '/var/run/mys
ජන 02 16:54:16 bandula zmwatch[1660]: ERR [Error reconnecting to db: errstr:Can't connect to local MySQL server through socket '/var/run/mys
~




It seems still could not connect db to local MySQL server

There was a discussion on this issue in GitHub .
https://github.com/ZoneMinder/zoneminder/issues/2685
Connor says that he has already made changes in zoneminder to accommodate mysql 8 .

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

Re: Installation : [2054] The server requested authentication method unknown to the client

Post by bbunge » Thu Jan 02, 2020 1:04 pm

There is a procedure in the wiki to get Zoneminder running on 19.10. Have not been able to use Mysql8...yet.

jonathanzm
Posts: 1
Joined: Thu Jan 30, 2020 4:56 pm

Re: Installation : [2054] The server requested authentication method unknown to the client

Post by jonathanzm » Thu Jan 30, 2020 4:59 pm

Just solved this doing a fresh install on 19.10 w mysql8.

First time visiting https://host/zm, got error
Unable to connect to ZM db.SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client

Solution: Change authentication method for 'zm' mysql user.
sudo mysql
ALTER USER 'zmuser'@'localhost' IDENTIFIED WITH mysql_native_password BY 'zmpass';

Restart mysql, restart zoneminder, success!

umbertones
Posts: 1
Joined: Thu Jun 11, 2020 2:15 pm

Re: Installation : [2054] The server requested authentication method unknown to the client

Post by umbertones » Thu Jun 11, 2020 2:18 pm

I can confirm that the ALTER USER command even fixed an existing 19.10 Ubuntu server that threw the error msg from the title in the first place after the zm installation.

@jonathanzm: Thanks for the post - it saved me a lot of time!

EDIT: I was installing a 1.35 ZM from the master-ppa

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests