Can't add Director Resource in Icinga Web 2

Hi together,

i’ve logged into mysql with mysql -u root -p and created a database and a user for Director with the following commands:

CREATE DATABASE director CHARACTER SET 'utf8';
CREATE USER director@localhost IDENTIFIED BY 'very-secure-password';
GRANT ALL ON director.* TO director@localhost;

In the Web Frontend i tried to add the needed Resource but it shows an error message stating that

Failed to successfully validate the configuration: Connection failed SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client

Validation Log:
Connection failed SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client

Screenshot of the error:

I tried restarting mysql and icinga2 but that doesn’t changed anything.

  • Director version (System - About):
  • Icinga Web 2 version: 2.7.3
  • Icinga 2 version (icinga2 --version): r2.11.2-1
  • Operating System and version: Ubuntu 20.04.2 LTS (Focal Fossa) with Kernel 5.4.0-1028-raspi
  • PHP versions: 7.3.28-1+ubuntu20.04.1+deb.sury.org+1
  • Webserver: mysql Ver 8.0.25-0ubuntu0.20.04.1 for Linux on aarch64 ((Ubuntu)

Can anyone point me in the right direction?

best regards
Rolf

Hello @rohabu, welcome :hugs: to the Icinga community.

The problem could possibly :thinking: be due to the fact that in mysql 8 standard authentication plug-in has been changed to auth_socket, however Icinga Web 2 still uses mysql_native_password as authentication method. Please run the following command in mysql and see if it works :eyes:.

ALTER USER 'director'@'localhost' IDENTIFIED WITH mysql_native_password BY 'very-secure-password';

Best,
Yonas

Thank you very much Yonas, that was exactly the problem! :slight_smile: