# MySQL 8.0 Connection

**URL:** <https://forum.inductiveautomation.com/t/mysql-8-0-connection/17848>\
**Category:** Ignition\
**Created:** [April 27, 2018, 2:03pm UTC](https://forum.inductiveautomation.com/t/mysql-8-0-connection/17848 "2018-04-27T14:03:42Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![ctonge](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@ctonge](https://forum.inductiveautomation.com/u/ctonge)\
**Post date:** [April 27, 2018, 2:03pm UTC](https://forum.inductiveautomation.com/t/mysql-8-0-connection/17848/1 "2018-04-27T14:03:42Z")

</div>

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)  
at com.inductiveautomation.ignition.gateway.datasource.DatasourceImpl.getConnectionInternal(DatasourceImpl.java:242)  
at com.inductiveautomation.ignition.gateway.datasource.DatasourceImpl.runTest(DatasourceImpl.java:196)  
at com.inductiveautomation.ignition.gateway.datasource.DatasourceManagerImpl$FaultedDatasourceRetryer$1.run(DatasourceManagerImpl.java:1014)  
at com.inductiveautomation.ignition.common.execution.impl.BasicExecutionEngine$TrackedTask.run(BasicExecutionEngine.java:565)  
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)  
at java.util.concurrent.FutureTask.runAndReset(Unknown Source)  
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)  
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)  
at java.lang.Thread.run(Unknown Source)  
Caused by: java.sql.SQLException: java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long  
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1074)  
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:988)  
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:974)  
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:919)  
at com.mysql.jdbc.ConnectionImpl.buildCollationMapping(ConnectionImpl.java:1062)  
at com.mysql.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:3556)  
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2513)  
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2283)  
at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:822)  
at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47)  
at sun.reflect.GeneratedConstructorAccessor91.newInstance(Unknown Source)  
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)  
at java.lang.reflect.Constructor.newInstance(Unknown Source)  
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)  
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:404)  
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:317)  
at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)  
at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)  
at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247)  
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221)  
… 12 more  
Caused by: java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long  
at com.mysql.jdbc.ConnectionImpl.buildCollationMapping(ConnectionImpl.java:1007)  
… 27 more

7.9.6 (b2018012914)  
Oracle Corporation 1.8.0\_162

---

<div class="post-metadata">

**Author:** ![ethomason](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ethomason/32/43338_2.png) [@ethomason](https://forum.inductiveautomation.com/u/ethomason)\
**Post date:** [April 27, 2018, 2:38pm UTC](https://forum.inductiveautomation.com/t/mysql-8-0-connection/17848/2 "2018-04-27T14:38:49Z")

</div>

Have you verified your versions based on [this chart](https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-versions.html)?

---

<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:** [April 27, 2018, 3:26pm UTC](https://forum.inductiveautomation.com/t/mysql-8-0-connection/17848/3 "2018-04-27T15:26:31Z")

</div>

There are some known issues with MySQL 8.0 and our current bundled JDBC driver. We’re working on a works-for-the-most-people solution, but you should also be aware that QA hasn’t fully tested MySQL 8.0 yet so it’s not guaranteed compatible.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [April 27, 2018, 3:40pm UTC](https://forum.inductiveautomation.com/t/mysql-8-0-connection/17848/4 "2018-04-27T15:40:23Z")

</div>

You can install the latest MySQL JDBC driver yourself if you don’t want to wait for us to ship an updated version.

---

<div class="post-metadata">

**Author:** ![ctonge](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@ctonge](https://forum.inductiveautomation.com/u/ctonge)\
**Post date:** [April 27, 2018, 4:08pm UTC](https://forum.inductiveautomation.com/t/mysql-8-0-connection/17848/5 "2018-04-27T16:08:11Z")

</div>

Thanks all, I’ll just roll back to 5.7 for now until the team vets the latest version and connector etc.

---

<div class="post-metadata">

**Author:** ![Curlyandshemp](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@Curlyandshemp](https://forum.inductiveautomation.com/u/Curlyandshemp)\
**Post date:** [May 4, 2018, 4:45pm UTC](https://forum.inductiveautomation.com/t/mysql-8-0-connection/17848/6 "2018-05-04T16:45:14Z")

</div>

I just got burned with this as well on a new installation

---

<div class="post-metadata">

**Author:** ![richardNZ15](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/richardnz15/32/33373_2.png) [@richardNZ15](https://forum.inductiveautomation.com/u/richardNZ15)\
**Post date:** [May 17, 2018, 4:26am UTC](https://forum.inductiveautomation.com/t/mysql-8-0-connection/17848/7 "2018-05-17T04:26:07Z")

</div>

Us too. Tried installing MySQL 8 with Ignition 7.9.5. Trying to install newest JDBC driver now but no luck getting it to connect

---

<div class="post-metadata">

**Author:** ![davoodnasehi](https://avatars.discourse-cdn.com/v4/letter/d/2bfe46/32.png) [@davoodnasehi](https://forum.inductiveautomation.com/u/davoodnasehi)\
**Post date:** [June 20, 2018, 1:42am UTC](https://forum.inductiveautomation.com/t/mysql-8-0-connection/17848/8 "2018-06-20T01:42:08Z")

</div>

I had the same problem.  
Just downladed mysql-connector-java-5.1.46.zip from MySQL and changed the driver for JDBC with the .jar file mysql-connector-java-5.1.46.jar. It worked.

---

<div class="post-metadata">

**Author:** ![trinkmeister](https://avatars.discourse-cdn.com/v4/letter/t/13edae/32.png) [@trinkmeister](https://forum.inductiveautomation.com/u/trinkmeister)\
**Post date:** [September 17, 2018, 7:05pm UTC](https://forum.inductiveautomation.com/t/mysql-8-0-connection/17848/9 "2018-09-17T19:05:02Z")

</div>

I had the same problem. Followed davoodnasehi recommendation:  
“Just downladed mysql-connector-java-5.1.46.zip from MySQL and changed the driver for JDBC with the .jar file mysql-connector-java-5.1.46.jar. It worked! Yey! ;-)”

---

<div class="post-metadata">

**Author:** ![philippe.timothee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/philippe.timothee/32/8572_2.png) [@philippe.timothee](https://forum.inductiveautomation.com/u/philippe.timothee)\
**Post date:** [January 15, 2019, 11:44pm UTC](https://forum.inductiveautomation.com/t/mysql-8-0-connection/17848/10 "2019-01-15T23:44:59Z")

</div>

is there any update on this matter ?  
I tried to use mysql-connector-java-8.0.13 or mysql-connector-java-5.1.46 and I can’t get a connection with either of these using 7.9.10 ☹

---

<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 15, 2019, 11:54pm UTC](https://forum.inductiveautomation.com/t/mysql-8-0-connection/17848/11 "2019-01-15T23:54:35Z")

</div>

> [@philippe.timothee](#):
>
> I tried to use mysql-connector-java-8.0.13 or mysql-connector-java-5.1.46 and I can’t get a connection with either of these using 7.9.10 ☹

There should be an error in the gateway logs - could you post it here (or get in contact with support?)  
A default install of 7.9.10 should work with MySQL 5 and 8, but restoring a .gwbk or upgrading may not be getting you the required changes to connection urls, drivers, etc.

---

<div class="post-metadata">

**Author:** ![philippe.timothee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/philippe.timothee/32/8572_2.png) [@philippe.timothee](https://forum.inductiveautomation.com/u/philippe.timothee)\
**Post date:** [January 15, 2019, 11:59pm UTC](https://forum.inductiveautomation.com/t/mysql-8-0-connection/17848/12 "2019-01-15T23:59:24Z")

</div>

hello  
I get the same  
org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long)  
… as noted above  
I have tried (and get to the same point)  
with changing the driver to point to  
mysql-connector-java-5.1.46  
mysql-connector-java-6.0.6  
mysql-connector-java-8.0.13  
yes, it’s a restored GW but I do that all the time and I am pretty confident, that’s not my problem

I’ll slack Ethan tomorrow 🙂  
thank you

---

<div class="post-metadata">

**Author:** ![philippe.timothee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/philippe.timothee/32/8572_2.png) [@philippe.timothee](https://forum.inductiveautomation.com/u/philippe.timothee)\
**Post date:** [May 15, 2019, 8:58pm UTC](https://forum.inductiveautomation.com/t/mysql-8-0-connection/17848/13 "2019-05-15T20:58:17Z")

</div>

this is a late update I apologize.  
I have resolved this error

in your KB there was a small mistake:  
[https://support.inductiveautomation.com/index.php?/Knowledgebase/Article/View/125/0/connection-errors-when-configuring-mysql-80-database-in-ignition](https://support.inductiveautomation.com/index.php?/Knowledgebase/Article/View/125/0/connection-errors-when-configuring-mysql-80-database-in-ignition)

convertToNull should be used instead of CONVERT\_TO\_NULL

hope this helps

---

<div class="post-metadata">

**Author:** ![twilliams](https://avatars.discourse-cdn.com/v4/letter/t/87869e/32.png) [@twilliams](https://forum.inductiveautomation.com/u/twilliams)\
**Post date:** [July 18, 2019, 5:35pm UTC](https://forum.inductiveautomation.com/t/mysql-8-0-connection/17848/14 "2019-07-18T17:35:49Z")

</div>

That fix worked. Thanks.

---

<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:** [May 21, 2020, 3:37pm UTC](https://forum.inductiveautomation.com/t/mysql-8-0-connection/17848/16 "2020-05-21T15:37:59Z")

</div>

Split this topic on May 21, 2020, 3:37pm UTC

A post was split to a new topic: [Issues with MySQL driver coercing types](https://forum.inductiveautomation.com/t/issues-with-mysql-driver-coercing-types/34941)
