# Manage Datasources

There are three commands to manage datasources.

## List all datasources

```
cfconfig datasource list
cfconfig datasource list from=serverName
cfconfig datasource list from=/path/to/server/home
```

To receive the data back as JSON, use the `--JSON` flag.

```
cfconfig datasource list --JSON
```

## Edit an existing or create a new datasource

Add a new datasource or update an existing datasource. Existing datasources will be matched based on the name. Valid dbdriver options are

* **MSSQL** -- SQL Server driver
* **MSSQL2** -- jTDS driver
* **PostgreSql**
* **Oracle**
* **Other** -- Custom JDBC URL
* **MySQL**

```
cfconfig datasource save name=myDSN dbdriver=mysql host=localhost port=3306 database=myDB username=brad password=foobar
cfconfig datasource save name=myDS ... to=serverName
cfconfig datasource save name=myDS ... to=/path/to/server/home
```

## Delete a datasource

Identify the datasource uniquely by the name.

```
cfconfig datasource delete foo
cfconfig datasource delete foo serverName
cfconfig datasource delete foo /path/to/server/home
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cfconfig.ortusbooks.com/using-the-cli/command-overview/manage-datasources.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
