# Connect to Database Server besides Gateway Connections

**URL:** <https://forum.inductiveautomation.com/t/connect-to-database-server-besides-gateway-connections/102356>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [February 14, 2025, 9:47am UTC](https://forum.inductiveautomation.com/t/connect-to-database-server-besides-gateway-connections/102356 "2025-02-14T09:47:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Farhan\_Basheer](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/farhan_basheer/32/66759_2.png) [@Farhan\_Basheer](https://forum.inductiveautomation.com/u/Farhan_Basheer)\
**Post date:** [February 14, 2025, 9:47am UTC](https://forum.inductiveautomation.com/t/connect-to-database-server-besides-gateway-connections/102356/1 "2025-02-14T09:47:30Z")

</div>

I was wondering, is it possible to connect to a database server, in my case MySql, using script or ignition designer property without defining the connection in the gateway connections?

---

<div class="post-metadata">

**Author:** ![jonathan.taylor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jonathan.taylor/32/4048_2.png) [@jonathan.taylor](https://forum.inductiveautomation.com/u/jonathan.taylor)\
**Post date:** [February 14, 2025, 10:14am UTC](https://forum.inductiveautomation.com/t/connect-to-database-server-besides-gateway-connections/102356/2 "2025-02-14T10:14:47Z")

</div>

You can connect to a database by setting it up as a datasource via scripting:

> **[system.db.addDatasource | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-db/system-db-addDatasource)**
>
> Adds a new database connection in Ignition.

I would hazard a guess that this would not work in an Edge gateway as there are restrictions edge's database connections

---

<div class="post-metadata">

**Author:** ![Farhan\_Basheer](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/farhan_basheer/32/66759_2.png) [@Farhan\_Basheer](https://forum.inductiveautomation.com/u/Farhan_Basheer)\
**Post date:** [February 14, 2025, 12:49pm UTC](https://forum.inductiveautomation.com/t/connect-to-database-server-besides-gateway-connections/102356/3 "2025-02-14T12:49:06Z")

</div>

Well this is the exact thing i was looking for, but it is the half solution, can we also remove the data source that was added via scripting?

---

<div class="post-metadata">

**Author:** ![Farhan\_Basheer](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/farhan_basheer/32/66759_2.png) [@Farhan\_Basheer](https://forum.inductiveautomation.com/u/Farhan_Basheer)\
**Post date:** [February 14, 2025, 12:50pm UTC](https://forum.inductiveautomation.com/t/connect-to-database-server-besides-gateway-connections/102356/4 "2025-02-14T12:50:10Z")

</div>

Oh yes we can.

```python
system.db.removeDatasource(name)

```
