Can't figure out how to configure database access on a Pi

Hi! I am very curious to check out this product, but ran into an issue when installing it on a Raspberry Pi 4 with Raspbian.

At the Database Resource step of IcingaWeb setup I get the error “Failed to successfully validate the configuration: SQLSTATE[HY000] [2002] No such file or directory”.

I have the following config:

Resource name: icingaweb_db
Database type: MySQL
Host: localhost
Database name: icingaweb_db

According to the install instructions, being a Debian-based OS, I should have done this first:

Preparing Web Setup on Debian/Ubuntu

On Debian and derivates, you need to manually create a database and a database user prior to starting the web wizard. This is due to local security restrictions whereas the web wizard cannot create a database/user through a local unix domain socket.

MariaDB [mysql]> CREATE DATABASE icingaweb2;

MariaDB [mysql]> GRANT ALL ON icingaweb2.* TO icingaweb2@localhost IDENTIFIED BY ‘CHANGEME’;
You may also create a separate administrative account with all privileges instead.

Note: This is only required if you are using a local database as authentication type.

However, I have no idea how to reach the MariaDB/mysql shell to run those commands.

Very grateful for any help :slight_smile:

Hi! I am very curious to check out this product, but ran into an issue when
installing it on a Raspberry Pi 4 with Raspbian.

At the Database Resource step of IcingaWeb setup I get the error “Failed
to successfully validate the configuration: SQLSTATE[HY000] [2002] No such
file or directory”
.

I have the following config:

Resource name: icingaweb_db
Database type: MySQL
Host: localhost
Database name: icingaweb_db

According to the install instructions, being a Debian-based OS, I should
have done this first:

Preparing Web Setup on Debian/Ubuntu

On Debian and derivates, you need to manually create a database and a
database user prior to starting the web wizard. This is due to local
security restrictions whereas the web wizard cannot create a
database/user through a local unix domain socket.

MariaDB [mysql]> CREATE DATABASE icingaweb2;

MariaDB [mysql]> GRANT ALL ON icingaweb2.* TO icingaweb2@localhost
IDENTIFIED BY ‘CHANGEME’; You may also create a separate administrative
account with all privileges instead.

Note: This is only required if you are using a local database as
authentication type.

However, I have no idea how to reach the MariaDB/mysql shell to run those
commands.

Very grateful for any help :slight_smile:

To “reach the MariaDB/MySQL shell” on a Debian machine, log in as root and
enter the command “mysql”.

Antony.

1 Like

Thanks!

MariaDB had not been installed by the Pi installation script from here: https://icinga.com/blog/2019/02/21/icinga-on-raspberry-pi/ - which makes sense, given that it doesn’t include it in the apt install list, d’oh!

So I got past that point, but now have a different problem :smiley:

It says in the Monitor config “Cannot find the IDO schema. Please verify that the given database contains the schema and that the configured user has access to it.” - I tried to create a new database for it along the lines of:

MariaDB [mysql]> CREATE DATABASE icingawebido;

MariaDB [mysql]> GRANT ALL ON icingawebido.* TO icingawebido@localhost
IDENTIFIED BY ‘mypass’;

Still no go :frowning:

My recommendation is to start again and do the following in sequence:

  1. Completely remove MySQL / MariaDB and Icingaweb2 from your machine.

  2. Install MySQL or MariaDB.

  3. Create the database ‘icingaweb2’ and the user ‘icingaweb2’ (with an
    appropriate password of your choice), as per the Icinga Debian documentation.

  4. Install Icingaweb2 and follow the same setup procedure as you did before,
    supplying the above password at the appropriate point.

If you then run into problems, by all means come back and let us know where
you got stuck.

Regards,

Antony.