--- title: "system.db.addDatasource" description: "Adds a new database connection in Ignition." --- # system.db.addDatasource > Adds a new database connection in Ignition. This function is used in **Python Scripting**. ## Description ## Client Permission Restrictions [Permission Type](projects\project-properties\project-properties.md#client---permissions): Datasource Management Client access to this scripting function is blocked to users that do not meet the role/zone requirements for the above permission type. This function is unaffected when run in the Gateway scope. ## Syntax `system.db.addDatasource(jdbcDriver, name, description, connectUrl, username, password, props, validationQuery, maxConnections)` ### Parameters Type | Parameter | Description ------- | ------- | ------ String | `jdbcDriver` | The name of the JDBC driver in Ignition. Required. String | `name` | The datasource name. Required. String | `description` | Description of the datasource String | `connectUrl` | Default is the connect URL for JDBC driver. String | `username` | Username to login to the datasource with. String | `password` | Password for the login. String | `props` | The extra connection parameters. String | `validationQuery` | Default is the validation query for the JDBC driver. Integer | `maxConnections` | Default is 8. ### Returns Nothing ### Scope All ## Code Examples ```python title="Example #1" # The following code would add a MySQL connection to the Gateway. system.db.addDatasource(jdbcDriver="MySQL ConnectorJ", name="MySQL", connectURL="jdbc:mysql://localhost:3306/test", username="root", password="password", props="zeroDateTimeBehavior=convertToNull;") ```