> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mindsdb.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect a Data Source

## Description

The `get_database()` and `create_database()` functions enable you to use the existing data source or connect a new one.

## Syntax

You can use the `get_database()` method to get an existing database:

```python theme={null}
mysql_demo_db = server.get_database('mysql_demo_db')
```

Or, the `create_database()` method to connect a new data source to MindsDB:

```python theme={null}
mysql_demo_db = server.create_database(
    engine = "mysql",
    name = "mysql_demo_db",
    connection_args = {
      "user": "user",
      "password": "MindsDBUser123!",
      "host": "samples.mindsdb.com",
      "port": "3306",
      "database": "public"
    }
)
```
