Error message 'Table ‘icingaweb.icingaweb_user’ doesn’t exist'

Hi everyone,
I’m getting this error when finishing the config of ICINGA:

Zend_Db_Statement_Exception in /usr/share/icingaweb2/library/vendor/Zend/Db/Statement/Pdo.php:225 with message: SQLSTATE[42S02]:
Base table or view not found:
1146 Table ‘icingaweb.icingaweb_user’ doesn’t exist, query was: SELECT COUNT(*) AS cnt FROM icingaweb_user WHERE (name = ‘admin’)

Can someone help me?
Thank you!

Hi and welcome!

The error state that you are missing a table in your icingaweb database, which most like comes from not having imported the db schema during setup.

Normally the setup wizard of the webinterface should take care of that.
You can import it afterwards manually as well.

Folder (for Debian/Ubuntu, others might differ):
/usr/share/icingaweb2/etc/schema
If it is a fresh setup do
mysql -u <database user> -p icingaweb < /usr/share/icingaweb2/etc/schema/mysql.schema.sql

If you have a running setup a did updates then you will have to import all schemas after the version you updated from found in the /mysql-upgrades

Hi @log1c, I’m running CENTOS7 in VM.

The steps i performed ar as below:
yum install icinga2-ido-mysql
mysql -u root -p
CREATE DATABASE icinga;
GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE VIEW, INDEX, EXECUTE ON icinga.* TO ‘icinga’@‘localhost’ IDENTIFIED BY ‘icinga’
CREATE DATABASE icingaweb;
GRANT ALL PRIVILEGES ON icingaweb.* TO ‘icingaweb’@‘localhost’ IDENTIFIED BY ‘icingaweb’;
FLUSH PRIVILEGES;
EXIR;

THe the command to import the Icinga 2 schema for our MySQL.

mysql -u root -p icinga < /usr/share/icinga2-ido-mysql/schema/mysql.sql
icinga2 feature enable ido-mysql
systemctl restart icinga2

nope, wrong one :wink:

You are missing the schema for Icinga Web 2
Table ‘icingaweb.icingaweb_user’ doesn’t exist
----------- ^^^^^^^^^^

This is a separate database only for the web interface

Go from here again: CentOS - Icinga Web

You most likely will have to enable the setup module again with icingacli module enable setup

The web setup will guide you through the process. When configuring the database for Icinga Web 2 make sure to input the correct database connection settings. If the setup then can’t import the schema with the data supplied it will ask for a privileged user (e.g. root)

Some time back I posted an overview of the communication of Icinga and its components. It might help you understand a bit better :slight_smile:

Hi @log1c

I switched database from local to on a seperate server and added its entry in ido conf file…when i log in to database server and enter into database, i don’t see any tables in icinga2…where as i can see these in 2 master nodes.

That is to be expected. Icinga2 doesn’t automatically create the schemas for the databases.

Why don’t you dump the database on the local node and import it to the remote one? This way you would keep all the data.
In case you really want to start fresh:
Icinga2 ido-mysql feature setup: Features - Icinga 2
If you are talking about Icinga WEB 2, see the post above.