Having trouble with mysql database

Hey I do the full run and install using an ansible playbook I created, but when I run the ./validate.php script in librenms folder i get this output.

====================================
Component | Version
--------- | -------
LibreNMS  | 1.41-47-g60a1a02f8
DB Schema | 0
PHP       | 7.0.30-0+deb9u1
MySQL     | 10.1.26-MariaDB-0+deb9u1
RRDTool   | 1.6.0
SNMP      | NET-SNMP 5.7.3
====================================

[OK]    Composer Version: 1.6.5
[OK]    Dependencies up-to-date.
MySQL Error: No database selected (SELECT `config_name`,`config_value` FROM `config`)
MySQL Error: No database selected (SELECT * FROM graph_types)
MySQL Error: No database selected (UPDATE `config` set `config_value` ='/usr/bin/fping' WHERE `config_name`='fping')
MySQL Error: No database selected (SELECT 1 FROM `config` WHERE `config_name`='fping')
MySQL Error: No database selected (INSERT INTO `config` (`config_name`,`config_value`,`config_default`,`config_descr`,`config_group`,`config_sub_group`)  VALUES ('fping','/usr/bin/fping','fping','Path to fping','external','paths'))
MySQL Error: No database selected (UPDATE `config` set `config_value` ='/usr/bin/fping6' WHERE `config_name`='fping6')
MySQL Error: No database selected (SELECT 1 FROM `config` WHERE `config_name`='fping6')
MySQL Error: No database selected (INSERT INTO `config` (`config_name`,`config_value`,`config_default`,`config_descr`,`config_group`,`config_sub_group`)  VALUES ('fping6','/usr/bin/fping6','fping6','Path to fping6','external','paths'))
MySQL Error: No database selected (UPDATE `config` set `config_value` ='/usr/bin/snmpgetnext' WHERE `config_name`='snmpgetnext')
MySQL Error: No database selected (SELECT 1 FROM `config` WHERE `config_name`='snmpgetnext')
MySQL Error: No database selected (INSERT INTO `config` (`config_name`,`config_value`,`config_default`,`config_descr`,`config_group`,`config_sub_group`)  VALUES ('snmpgetnext','/usr/bin/snmpgetnext','snmpgetnext','Path to snmpgetnext','external','paths'))
MySQL Error: No database selected (UPDATE `config` set `config_value` ='/usr/bin/rrdtool' WHERE `config_name`='rrdtool')
MySQL Error: No database selected (SELECT 1 FROM `config` WHERE `config_name`='rrdtool')
MySQL Error: No database selected (INSERT INTO `config` (`config_name`,`config_value`,`config_default`,`config_descr`,`config_group`,`config_sub_group`)  VALUES ('rrdtool','/usr/bin/rrdtool','rrdtool','Path to rrdtool','external','paths'))
MySQL Error: No database selected (SELECT version FROM `dbSchema` ORDER BY version DESC LIMIT 1)
MySQL Error: No database selected (SELECT version FROM `dbSchema` ORDER BY version DESC LIMIT 1)
[FAIL]  Error connecting to your database. Could not select database: librenms. Access denied for user 'librenms'@'localhost' to database 'librenms'
[FAIL]  Your database schema (0) is older than the latest (255).
        [FIX] Manually run ./daily.sh, and check for any errors.
MySQL Error: No database selected (SELECT COUNT(*) FROM `devices`)
[WARN]  You have not added any devices yet.
        [FIX] You can add a device in the webui or with ./addhost.php
MySQL Error: No database selected (SELECT version FROM `dbSchema` ORDER BY version DESC LIMIT 1)

I’ve looked around and none of the other ways to fix seem to solve my issue.

I’ve got fping installed and my config.php file look like everything is good to go. Any suggestions or ideas?

Did you correctly set up mysql credentials in .env file?

I checked and the contents are:

APP_KEY=

DB_HOST=localhost
DB_DATABASE=librenms
DB_USERNAME=librenms
DB_PASSWORD=pass-> an actual pass is here

#APP_URL=
NODE_ID=node_id -> an actual node_id is here
LIBRENMS_USER=librenms

Ok. Did you added the user in the mysql? Try running ./mysql -u librenms -p librenms and use the password in the .env file.

When running that i get: ERROR 1044 (42000): Access denied for user 'librenms'@'localhost' to database 'librenms'

There you go. Or you didnt created the user or you did but with different password

I’m pretty sure i used the same password for everything though. So I’m a little confused as to why it doesn’t want to cooperate

Maybe you didnt grant to librenms@localhost?

This issue got solved. Quote syntax was off.