# Mysql connection error with the gateway

**URL:** <https://forum.inductiveautomation.com/t/mysql-connection-error-with-the-gateway/30827>\
**Category:** Ignition\
**Created:** [December 19, 2019, 3:19pm UTC](https://forum.inductiveautomation.com/t/mysql-connection-error-with-the-gateway/30827 "2019-12-19T15:19:43Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![shemelis.2013](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@shemelis.2013](https://forum.inductiveautomation.com/u/shemelis.2013)\
**Post date:** [December 19, 2019, 3:19pm UTC](https://forum.inductiveautomation.com/t/mysql-connection-error-with-the-gateway/30827/1 "2019-12-19T15:19:43Z")

</div>

What is the source of following error message ?

Cannot create PoolableConnectionFactory (Access denied for user ‘root’@‘localhost’ (using password: YES))

 ![sql](https://us1.discourse-cdn.com/inductiveautomation/original/2X/6/60ce6a4283d2d2b8710553a873f8c579110128d4.png)  
 ![sql](https://us1.discourse-cdn.com/inductiveautomation/original/2X/6/60ce6a4283d2d2b8710553a873f8c579110128d4.png)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 19, 2019, 3:23pm UTC](https://forum.inductiveautomation.com/t/mysql-connection-error-with-the-gateway/30827/2 "2019-12-19T15:23:43Z")

</div>

Access denied looks pretty clear to me. Your user name and password for the connection don’t match what MySQL has configured.

---

<div class="post-metadata">

**Author:** ![shemelis.2013](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@shemelis.2013](https://forum.inductiveautomation.com/u/shemelis.2013)\
**Post date:** [December 20, 2019, 1:05pm UTC](https://forum.inductiveautomation.com/t/mysql-connection-error-with-the-gateway/30827/3 "2019-12-20T13:05:18Z")

</div>

Until now I don’t sort out the issue, my SQL password and admin is the same with my ignition gateway Config  Database-Database Connections password and admin ,any one assist me with step by step solution ?

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [December 20, 2019, 1:09pm UTC](https://forum.inductiveautomation.com/t/mysql-connection-error-with-the-gateway/30827/4 "2019-12-20T13:09:46Z")

</div>

Can you login to mySQL using workbench with the same root username and password?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 20, 2019, 1:25pm UTC](https://forum.inductiveautomation.com/t/mysql-connection-error-with-the-gateway/30827/5 "2019-12-20T13:25:46Z")

</div>

Note that MySQL can and usually does enforce different passwords based on the origin of the connection. Note in your error that the refused connection is for root@localhost. That’s a different “user” than when connecting as “root” from a different machine. (And you probably shouldn’t be connecting as a root user, anyways.)

---

<div class="post-metadata">

**Author:** ![shemelis.2013](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@shemelis.2013](https://forum.inductiveautomation.com/u/shemelis.2013)\
**Post date:** [December 20, 2019, 4:23pm UTC](https://forum.inductiveautomation.com/t/mysql-connection-error-with-the-gateway/30827/6 "2019-12-20T16:23:26Z")

</div>

yes I have the same user name and password with my gateway data base config

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 20, 2019, 4:48pm UTC](https://forum.inductiveautomation.com/t/mysql-connection-error-with-the-gateway/30827/7 "2019-12-20T16:48:41Z")

</div>

> [@shemelis.2013](#):
>
> the same user name and password

Are you working directly on the server? The error is Ignition failing to connect to the database on the same server (localhost). If you are testing your connection from another computer, the password lookup is probably "root@%". That's a different user from "root@localhost" in MySQL. Look in your DB's privilege table.

---

<div class="post-metadata">

**Author:** ![shemelis.2013](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@shemelis.2013](https://forum.inductiveautomation.com/u/shemelis.2013)\
**Post date:** [December 20, 2019, 5:02pm UTC](https://forum.inductiveautomation.com/t/mysql-connection-error-with-the-gateway/30827/8 "2019-12-20T17:02:56Z")

</div>

yes I am working on the same server. my DB current status of users and privileges table is attached

 ![SQL%202](https://us1.discourse-cdn.com/inductiveautomation/original/2X/e/eeed25e8f0e3adcc03094c70169bbf7c4b5bce83.png)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 20, 2019, 5:15pm UTC](https://forum.inductiveautomation.com/t/mysql-connection-error-with-the-gateway/30827/9 "2019-12-20T17:15:33Z")

</div>

Hmm. MySQL 8.0. Have you verified you are using the right JDBC driver?

> [@MySQL 8.0 Connection](http://forum.inductiveautomation.com/t/mysql-8-0-connection/17848):
>
> Anyone install MySQL 8.0 and connect with Ignition? I get an error when I attempt. Wondering if maybe the java MySQL driver needs to be updated to work… org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880) a…

---

<div class="post-metadata">

**Author:** ![shemelis.2013](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@shemelis.2013](https://forum.inductiveautomation.com/u/shemelis.2013)\
**Post date:** [December 22, 2019, 4:18pm UTC](https://forum.inductiveautomation.com/t/mysql-connection-error-with-the-gateway/30827/10 "2019-12-22T16:18:14Z")

</div>

It is working…  
Thank you very much and have a nice holiday!

---

<div class="post-metadata">

**Author:** ![ahad99.shalwani](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ahad99.shalwani/32/76824_2.png) [@ahad99.shalwani](https://forum.inductiveautomation.com/u/ahad99.shalwani)\
**Post date:** [May 4, 2021, 6:30am UTC](https://forum.inductiveautomation.com/t/mysql-connection-error-with-the-gateway/30827/11 "2021-05-04T06:30:35Z")

</div>

Please help me to fix this issue.

![Picture1](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/c/3c0f505b6c32f7fe918805d4d710a1850b3f6d33.png)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [May 4, 2021, 9:46am UTC](https://forum.inductiveautomation.com/t/mysql-connection-error-with-the-gateway/30827/12 "2021-05-04T09:46:17Z")

</div>

Your screenshot is unreadable. Please copy the complete text of the error and paste into a comment as text. Then highlight what you’ve pasted and use the “preformat” button (this: \</\> ) to box it neatly.

---

<div class="post-metadata">

**Author:** ![Federick732000](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/federick732000/32/23954_2.png) [@Federick732000](https://forum.inductiveautomation.com/u/Federick732000)\
**Post date:** [May 4, 2021, 10:08am UTC](https://forum.inductiveautomation.com/t/mysql-connection-error-with-the-gateway/30827/13 "2021-05-04T10:08:48Z")

</div>

@ahad99.shalwani It seems that you are trying to read/write on a database that doesn’t exists. On the error you can see that it says:

```auto
Caused by: java.sql.SQLSyntaxErrorException: Unknown database 'test'

```

So be sure that the database called **test** does exist.

---

<div class="post-metadata">

**Author:** ![ahad99.shalwani](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ahad99.shalwani/32/76824_2.png) [@ahad99.shalwani](https://forum.inductiveautomation.com/u/ahad99.shalwani)\
**Post date:** [May 18, 2021, 8:22pm UTC](https://forum.inductiveautomation.com/t/mysql-connection-error-with-the-gateway/30827/14 "2021-05-18T20:22:44Z")

</div>

Problem resolved thanks pturmel and federick.
