# MariaDB problems

**URL:** <https://forum.inductiveautomation.com/t/mariadb-problems/36416>\
**Category:** Maker\
**Created:** [July 7, 2020, 2:03am UTC](https://forum.inductiveautomation.com/t/mariadb-problems/36416 "2020-07-07T02:03:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ken.maze](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ken.maze/32/85876_2.png) [@ken.maze](https://forum.inductiveautomation.com/u/ken.maze)\
**Post date:** [July 7, 2020, 2:03am UTC](https://forum.inductiveautomation.com/t/mariadb-problems/36416/1 "2020-07-07T02:03:22Z")

</div>

Hi,

I have installed Ignition Maker on a Raspberry Pi 3B, 128Gb card. I have been trying to connect to my MariaDB database on localhost with no luck.

I get:

java.sql.SQLException: Cannot create PoolableConnectionFactory (Access denied for user ‘root’@‘localhost’)

I have confirmed in many different ways that my username and password are correct and have necessary privileges. I can run mysql and mysqladmin from the command line with these credentials.

I also noticed if I don’t sudo with these on the CLI I get the same error message. I do start the gateway with the command line:

```
     sudo ./ignition.sh start

```

so I assume I have the privilege I need to connect.

What am I missing?

Thanks  
Ken

---

<div class="post-metadata">

**Author:** ![Kevin.Collins](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.collins/32/13497_2.png) [@Kevin.Collins](https://forum.inductiveautomation.com/u/Kevin.Collins)\
**Post date:** [July 7, 2020, 2:38am UTC](https://forum.inductiveautomation.com/t/mariadb-problems/36416/2 "2020-07-07T02:38:51Z")

</div>

By the looks of that error message, you are getting through to MariaDB and it is indeed just rejecting your credentials. What database are you connecting to in the connection config (it might help to post a screenshot of that)? It could be that the database you’re connecting to doesn’t have the right privilege GRANTs, possibly.

---

<div class="post-metadata">

**Author:** ![ken.maze](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ken.maze/32/85876_2.png) [@ken.maze](https://forum.inductiveautomation.com/u/ken.maze)\
**Post date:** [July 7, 2020, 3:04am UTC](https://forum.inductiveautomation.com/t/mariadb-problems/36416/3 "2020-07-07T03:04:01Z")

</div>

Thanks for the reply.

The config is:

> jdbc:mariadb://localhost:3306/HomeTransactions

If, from command line on the gateway pi, I input:

> sudo mysql -u root -D HomeTransactions -p

I successfully log on. If I then type:

> SHOW GRANTS;

I get:

> +------------------------------------------------------------------------------------------------+  
> | Grants for root@localhost |  
> +------------------------------------------------------------------------------------------------+  
> | GRANT ALL PRIVILEGES ON _._ TO 'root'@'localhost' IDENTIFIED VIA unix\_socket WITH GRANT OPTION |  
> | GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION |  
> +------------------------------------------------------------------------------------------------+

So I _think_ that I have all the privileges for that user that are needed. Let me know if you see something I've missed.

Ken

---

<div class="post-metadata">

**Author:** ![koryk](https://avatars.discourse-cdn.com/v4/letter/k/cdc98d/32.png) [@koryk](https://forum.inductiveautomation.com/u/koryk)\
**Post date:** [July 7, 2020, 3:39pm UTC](https://forum.inductiveautomation.com/t/mariadb-problems/36416/4 "2020-07-07T15:39:05Z")

</div>

Hey Ken, I also had to bind the address in the MariaDB.cnf file, and restart the service. As my setup is a air gap with no outside access, I simply bound to 0.0.0.0. Then I hashed the root password, and granted all privileges. Not at all secure, but like I said, I am air gapped with non-critical data, so I wasn’t concerned about the security, just making it work.

sudo gedit /etc/mysql/mariadb.cnf  
• bind-address = 0.0.0.0  
sudo systemctl restart mysql.service

```
• GRANT ALL PRIVILEGES ON *.* TO 'root'@'fullyQualifiedHostName' IDENTIFIED BY PASSWORD '*HashedRootPassword' WITH GRANT OPTION;
```

---

<div class="post-metadata">

**Author:** ![ken.maze](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ken.maze/32/85876_2.png) [@ken.maze](https://forum.inductiveautomation.com/u/ken.maze)\
**Post date:** [July 9, 2020, 2:45am UTC](https://forum.inductiveautomation.com/t/mariadb-problems/36416/5 "2020-07-09T02:45:54Z")

</div>

That seems to have worked! I think it was the privilege grant, I put the binding back to 127.0.0.1 and that works fine.

Thanks!
