# Synology SNMP Monitoring with LibreNMS - Could not connect to database

**URL:** <https://forums.jasonloong.com/t/synology-snmp-monitoring-with-librenms-could-not-connect-to-database/42>\
**Category:** Uncategorized\
**Created:** [July 21, 2021, 5:01pm UTC](https://forums.jasonloong.com/t/synology-snmp-monitoring-with-librenms-could-not-connect-to-database/42 "2021-07-21T17:01:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JasterMereel](https://forums.jasonloong.com/user_avatar/forums.jasonloong.com/jastermereel/32/69_2.png) [@JasterMereel](https://forums.jasonloong.com/u/JasterMereel)\
**Post date:** [July 21, 2021, 5:01pm UTC](https://forums.jasonloong.com/t/synology-snmp-monitoring-with-librenms-could-not-connect-to-database/42/1 "2021-07-21T17:01:00Z")

</div>

Hi, there.

I’m following this tutorial. I am doing this on a DS418play with 6GB or RAM.

So, I am going through the tutorial and I get to the " Configure LibreNMS Database & User Creation". That is when I start to run into problems. Whenever I run this command.

```auto
docker exec librenms setup_database

```

I get the error message of “Could not connect to database, check logs/librenms.log.” I check the logs (there’s a ton in there), and the only thing that I can see is “Access denied for user ‘librenms’@‘172.17.0.4’ (using password: YES) at  
/opt/librenms/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:39)”.

I’ve ensured that the password in all of the configs is correct. Anything else I can try?

---

<div class="post-metadata">

**Author:** ![jasonloong](https://forums.jasonloong.com/user_avatar/forums.jasonloong.com/jasonloong/32/8_2.png) [@jasonloong](https://forums.jasonloong.com/u/jasonloong)\
**Post date:** [July 21, 2021, 5:07pm UTC](https://forums.jasonloong.com/t/synology-snmp-monitoring-with-librenms-could-not-connect-to-database/42/2 "2021-07-21T17:07:53Z")

</div>

You need to set permission on your Syno MariaDB database to allow from 172 subnet (assuming you are still using Syno’s MariaDB as per previous post)

Access your Syno MariaDB CLI, and run the following:

I would suggest “dropping”/deleting the new LibreNMS DB and create a new one:

**TAKEN FROM TUTORIAL FOR NEW DB**

- run this in your Syno MariaDB CLI

```auto
CREATE DATABASE librenms CHARACTER SET utf8 COLLATE utf8_unicode_ci;
CREATE USER 'librenms'@'%' IDENTIFIED BY 'libre_password';
CREATE USER 'librenms'@'localhost' IDENTIFIED BY 'libre_password';
GRANT ALL PRIVILEGES ON librenms.* TO 'librenms'@'%';
FLUSH PRIVILEGES;
exit

```

The command explained:  
`GRANT ALL PRIVILEGES ON librenms.* TO 'librenms'@'%';`  
This allows all IP to access user “librenms”

---

<div class="post-metadata">

**Author:** ![jasonloong](https://forums.jasonloong.com/user_avatar/forums.jasonloong.com/jasonloong/32/8_2.png) [@jasonloong](https://forums.jasonloong.com/u/jasonloong)\
**Post date:** [July 21, 2021, 5:19pm UTC](https://forums.jasonloong.com/t/synology-snmp-monitoring-with-librenms-could-not-connect-to-database/42/3 "2021-07-21T17:19:41Z")

</div>

If you are using MariaDB as container, following the tutorial as is should just work

If your DB is located in Syno’s MariaDB, run the above to enable access

and also check out this [Error when setup database - #12 by fred](https://forums.jasonloong.com/t/error-when-setup-database/25/12)

In your case it would be to allow all from 172. **17**.0.0/255.255.0.0

Syno’s firewall might be blocking access to Syno’s MariaDB
