# MySQL on Debian Linux Gateway - Installation and Connection Error

**URL:** <https://forum.inductiveautomation.com/t/mysql-on-debian-linux-gateway-installation-and-connection-error/55262>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [January 21, 2022, 5:45pm UTC](https://forum.inductiveautomation.com/t/mysql-on-debian-linux-gateway-installation-and-connection-error/55262 "2022-01-21T17:45:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pridesleap](https://avatars.discourse-cdn.com/v4/letter/p/f4b2a3/32.png) [@pridesleap](https://forum.inductiveautomation.com/u/pridesleap)\
**Post date:** [January 21, 2022, 5:45pm UTC](https://forum.inductiveautomation.com/t/mysql-on-debian-linux-gateway-installation-and-connection-error/55262/1 "2022-01-21T17:45:18Z")

</div>

Slowly working my way through IU training and I am now at the point of building a demonstration system. I am trying to install MySQL and create a DB connection. My Ignition Gateway and MySQL DB are installed on the same headless Debian Linux server. Here are the steps I took:

1. I installed MySQL 8.0 via the **mysql-apt-config\_0.8.22-1\_all.deb** package obtained from Oracle.
2. I installed the connector via the **mysql-connector-java\_8.0.28-1debian11\_all.deb** obtained from Oracle
3. I recieved the “missing files” error when attempting to create the connection in the Database connections configuration page. To solve this (this may be the incorrect method) I copied the **mysql-connector-java-8.0.28.jar** file from the /usr/share/java folder on the server to my Windows client so I then point to it when updating the driver file.
4. I then created a DB connection, which faulted with the following error:

```auto
java.sql.SQLException: Cannot create PoolableConnectionFactory (Access denied for user 'sa'@'localhost' (using password: YES))
	at org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:656)
	at org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:534)
	at org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:734)
	at com.inductiveautomation.ignition.gateway.datasource.DatasourceImpl.getConnectionInternal(DatasourceImpl.java:273)
	at com.inductiveautomation.ignition.gateway.datasource.DatasourceImpl.runTest(DatasourceImpl.java:226)
	at com.inductiveautomation.ignition.gateway.datasource.DatasourceManagerImpl$FaultedDatasourceRetryer.lambda$newRetryRunnable$0(DatasourceManagerImpl.java:1064)
	at com.inductiveautomation.ignition.common.execution.impl.BasicExecutionEngine$TrackedTask.run(BasicExecutionEngine.java:582)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.runAndReset(Unknown Source)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLException: Access denied for user 'sa'@'localhost' (using password: YES)
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
	at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:829)
	at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:449)
	at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:242)
	at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:198)
	at org.apache.commons.dbcp2.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:52)
	at org.apache.commons.dbcp2.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:357)
	at org.apache.commons.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:103)
	at org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:652)
	... 12 more

8.1.12 (b2021111810)
Azul Systems, Inc. 11.0.11

```

Any ideas on where to start?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [January 21, 2022, 6:00pm UTC](https://forum.inductiveautomation.com/t/mysql-on-debian-linux-gateway-installation-and-connection-error/55262/2 "2022-01-21T18:00:17Z")

</div>

> [@pridesleap](#):
>
> `Caused by: java.sql.SQLException: Access denied for user 'sa'@'localhost' (using password: YES)`

The error's pretty straightforward. Make sure your credentials are correct, or, better, make a new user account on MySQL just for Ignition to use, instead of your `sa` account (even for a testing system, it's not really a good practice).

---

<div class="post-metadata">

**Author:** ![pridesleap](https://avatars.discourse-cdn.com/v4/letter/p/f4b2a3/32.png) [@pridesleap](https://forum.inductiveautomation.com/u/pridesleap)\
**Post date:** [January 21, 2022, 6:04pm UTC](https://forum.inductiveautomation.com/t/mysql-on-debian-linux-gateway-installation-and-connection-error/55262/3 "2022-01-21T18:04:30Z")

</div>

I think you are on to something. When I installed MySQL, I didn’t create an acount. So, MySQL is either not accepting the credentials I am giving it for the default user account that was created during installation or there arent any accounts at all.

Let me explore what accounts exist in the existing MySQL installaiton and if necessary I’ll create a new one as you suggest. I’ll report back.

---

<div class="post-metadata">

**Author:** ![pridesleap](https://avatars.discourse-cdn.com/v4/letter/p/f4b2a3/32.png) [@pridesleap](https://forum.inductiveautomation.com/u/pridesleap)\
**Post date:** [January 21, 2022, 7:10pm UTC](https://forum.inductiveautomation.com/t/mysql-on-debian-linux-gateway-installation-and-connection-error/55262/4 "2022-01-21T19:10:09Z")

</div>

Issue is resolved. There were actualy two problems:

1. When I created the DB connection in Ignition, I was not using the correct password for the default root user. Once I used the correct password, I cleared the authentication error. However (see point #2).
2. The DB Configuration was pointing to a “test” database in the connection configuration that didn’t exist. I had to manualy create a “test” database in MySQL.

Once I perofrmed the above actions, I was able to create a VALID DB connection in ignition.

As previosuly suggested, I created a second user with permissions and created a new connection using those credentials instead.

Thank you for the support.
