Question

Database issue : ERROR 1049 (42000): Unknown database 'centreon'

  • 27 March 2023
  • 6 replies
  • 572 views

Userlevel 1
Badge +6

Hello,

 

I have an issue with my Centreon database.

SQLSTATE[HY000] [1045] Access denied for user centreon (using password: YES)

 

So I created a user centreon and I have now :

ERROR 1049 (42000): Unknown database 'centreon'

 

When I write show databases, I have 

+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
3 rows in set (0.000 sec)
 

So I think database is deleted. I don’t know what happened because I don’t change anything.

 

How to solve that without reset my configuration and adding manually hundreds of devices ?

 

I don’t have any access to my web interface due to that

 

Thanks and have a nice day !


6 replies

Badge +3

Hello,
Use root account and make sure that Your database is still exists.

You also need to check grants for user centreon, maybe he doesn't have access to database.

Userlevel 1
Badge +6

Even with root account I can’t find my database.

 

I grant all privileges to user Centreon.

At start it doesn’t have privileges to access to databases, but now it can’t find the database

Hello,
Use root account and make sure that Your database is still exists.

You also need to check grants for user centreon, maybe he doesn't have access to database.

 

Userlevel 1
Badge +6

Is there a way to generate a new database using configuration files ?

Badge +3

Check on your master server localisation /var/cache/centreon/backup which is default backup area.

Maybe u will find there backups of Your database.
If not i dont know how to help :(

Userlevel 1
Badge +6

sudo ls /var/cache/centreon/
config/  symfony/
 

Sadly there is no backup (it was configured).

I think next time I’ll make a backup out of the server

 

We had a backup of the VM but it still don’t work too.

Userlevel 1
Badge +6

I think the problem came from backup script which corrupt my database partition.

Someone have a backup script compatible with Debian 11 to backup configuration files and databases ?

Reply