Daily Update Fail - Could not connect to database

librenms@librenms:~$ sudo ./daily.sh
[sudo] password for librenms:
Re-running /opt/librenms/daily.sh as librenms user
Could not connect to database, check logs/librenms.log.
Updating SQL-Schema OK
Cleaning up DB OK
Could not connect to database, check logs/librenms.log.

librenms@librenms:~$ ./validate.php

Component Version
LibreNMS 1.48.1-25-g21192a9
DB Schema Not Connected (0)
PHP 7.2.15-1+ubuntu16.04.1+deb.sury.org+1
RRDTool 1.5.5


[OK] Composer Version: 1.8.4
[OK] Dependencies up-to-date.
Could not connect to database, check logs/librenms.log.

Can you manually connect to database? your credentials are in config.php AND .env files

Please help on how to connect to the database - command. I am not good in database
tried this : librenms@librenms:~$ mysql -u librenms -p
Enter password:
ERROR 1045 (28000): Access denied for user ‘librenms’@‘localhost’ (using password: YES)

So if you entered your password and it says Access Denied, then your password is wrong. Which is why LibreNMS cannot connect.

Try login as root user and see if you can recover.

But i verified the password in config.php & the .env files

You need to login to mysql first using that connect line your using, forget librenms for now.

Once you login, then you can go back to librenms and use those working credentials in config.php and .env

If you really cannot login to the database even with “root” user, than as a last resort you can reset the root password, and then reset the librenms password for the librenms user. Or put your root credentials into the config.php and .env if you are happy with that.


Thank you Chas, I will give you update tomorrow. The client is knocking off from office

@Kagiso_Sepato you didnt specified database.

Try: mysql -u librenms -p librenms (asuming both user and database are librenms)

Did you grant privileges for the user librenms on your database?

GRANT ALL PRIVILEGES ON librenms.* TO ‘librenms’@‘localhost’;

I assume this is Mysql not MariaDB

I ran this command below:

@Kagiso_Sepato try what I said before:

mysql -u librenms -p librenms <-- NOTE: the last librenms is not the password, is the database.

With the password from config.php/.env files

I am still failing miserably with the password from the config.php

Then somehow you changed your librenms sql password. Do you remember the root one?

Or maybe it just doesnt have password.

Try mysql -u root or if you have root password, mysql -u root -p

perhaps! I was not the one who setup Librenms plus i am newly employed by the company. So most of the documented passwords were not going through so for servers i had to bypass login by tweaking at grub.


Sorry I didn’t get back to you. Are you still having a problem with this?

where is the config file, i can see config.php.default but no password is in there?