MariaDB problems

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

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.

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

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;

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!