# Attempting to use system.db.addDatasource

**URL:** <https://forum.inductiveautomation.com/t/attempting-to-use-system-db-adddatasource/43091>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [February 6, 2021, 4:25am UTC](https://forum.inductiveautomation.com/t/attempting-to-use-system-db-adddatasource/43091 "2021-02-06T04:25:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![valverde.anthony](https://avatars.discourse-cdn.com/v4/letter/v/278dde/32.png) [@valverde.anthony](https://forum.inductiveautomation.com/u/valverde.anthony)\
**Post date:** [February 6, 2021, 4:25am UTC](https://forum.inductiveautomation.com/t/attempting-to-use-system-db-adddatasource/43091/1 "2021-02-06T04:25:48Z")

</div>

Using Version: 8.0.17

Hello everyone, I’m attempting to use the system.db.addDatasource function

[https://docs.inductiveautomation.com/display/DOC80/system.db.addDatasource](https://docs.inductiveautomation.com/display/DOC80/system.db.addDatasource)

It seems passing in the jdbcDriver as “MYSQL” or “MySQL” is causing errors.

I’ve created all connection types and used system.db.getConnections to get the “DBType” to pass into this variable.

It seems even when I use the example on the system.db.addDatasource documentation page, I receive the same error.

java.lang.Exception: java.lang.Exception: JDBC driver ‘MySQL’ not found

Does anyone have any insight on the situation? Thank you in advance!

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [February 6, 2021, 4:50pm UTC](https://forum.inductiveautomation.com/t/attempting-to-use-system-db-adddatasource/43091/2 "2021-02-06T16:50:06Z")

</div>

I would imagine that is a typo in the 8.x documentation.

The code for 7.9x shows as

`system.db.addDatasource(jdbcDriver` `=` `"MySQL ConnectorJ"` `, name` `=` `"MySQL"` `, `

`connectURL` `=` `"jdbc:mysql://localhost:3306/test"` `, username` `=` `"root"` `, `

`password` `=` `"password"` `, props` `=` `"zeroDateTimeBehavior=convertToNull;"` `)`

So the driver name for MySQL should be MySQL ConnectorJ

@Paul.Scott

---

<div class="post-metadata">

**Author:** ![valverde.anthony](https://avatars.discourse-cdn.com/v4/letter/v/278dde/32.png) [@valverde.anthony](https://forum.inductiveautomation.com/u/valverde.anthony)\
**Post date:** [February 7, 2021, 3:28am UTC](https://forum.inductiveautomation.com/t/attempting-to-use-system-db-adddatasource/43091/3 "2021-02-07T03:28:04Z")

</div>

Thank you very much, this was the solution. I should have looked at previous documentation. For anyone else, the driver names are exactly as they appear on the gateway page when trying to add a connection manually!

---

<div class="post-metadata">

**Author:** ![Paul.Scott](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul.scott/32/4578_2.png) [@Paul.Scott](https://forum.inductiveautomation.com/u/Paul.Scott)\
**Post date:** [February 8, 2021, 4:54pm UTC](https://forum.inductiveautomation.com/t/attempting-to-use-system-db-adddatasource/43091/4 "2021-02-08T16:54:14Z")

</div>

Correct, the function is looking for the name of the JDBC driver, as configured on the gateway. It looks like the initial name of the MySQL JDBC driver on new installations was changed sometime in 8.0’s lifespan.

I updated the example so it’s not so misleading for future folks trying to add MySQL connections. Thanks for lettings us know!
