I get the error: "MySQL Error: Could not select database: librenms. Access denied for user 'librenms'@'localhost' to database 'librenms'" <---- This is via ansible
However when i go into mysql using mysql -u root -p and run show grants for 'librenms'@'localhost';
I get shown that:
+-----------------------------------------------------------------------------------------------------------------+
| Grants for librenms@localhost |
+-----------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'librenms'@'localhost' IDENTIFIED BY PASSWORD '*bunchofstuffhere' |
| GRANT ALL PRIVILEGES ON `*librenms`.* TO 'librenms'@'localhost' |
+-----------------------------------------------------------------------------------------------------------------+
What am i missing here that’s breaking my access to librenms with my librenms account?
Like my database pass and user dont match? How would I fix this when I did it through an ansible playbook with the same password for the user, database, and everything sql related?
EDIT: I commented everything out and still got the same error
Ok. I’m also facing an issue that if I set the same stuff that I have setup in ansible manually (mysql permissions and such then everything works just fine), but the automation via ansible breaks it. Could this be due to that same issue or is ansible automation with mysql not allowing something to work with the permissions?
I did a test and remade the whole machine (vm) and tested with making no password for the user.
Then I ran ./validate.php and received this:
====================================
Component | Version
--------- | -------
LibreNMS | 1.41-50-g8f4a041b8
DB Schema | ?
PHP | 7.0.30-0+deb9u1
MySQL | ?
RRDTool | 1.6.0
SNMP | NET-SNMP 5.7.3
====================================
[OK] Composer Version: 1.6.5
[OK] Dependencies up-to-date.
[FAIL] Error connecting to your database. Access denied for user 'librenms'@'localhost' (using password: NO)
[WARN] Could not check poller/discovery, db is not connected.