# Configure a database connection

## Procedure overview

Configure the parameters of a new database connection using the interface provided for the selected database type. Read the procedures below to do the following:

* Configure connection parameters based on the selected database type

* (Optional) Configure SSH tunneling

* (Optional) Configure database introspection scope

* (Optional) Configure JDBC driver optional parameters

## Procedures

Procedure: Open the New database connection dialog

The procedure depends on whether you want to create a new database connection in workspace resources or in a notebook.

In a workspace:

1.  In the sidebar on the Home page, select the workspace where you want to create a database connection.

2.

In the workspace resources, select ![Document](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/document.svg) Data and switch to the Databases tab.

!['Databases' tab](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/ws-databases.png)

3.  Click ![Plus icon](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/plus.svg) New database connection at the top right.

In a notebook:

1.  In the sidebar, select ![Attach](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/attach.svg) (Attached data).

2. Switch to the Databases tab.

3.

Click ![Plus](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/plus.svg)New database.

![The Attached data section in a notebook with the Databases tab open](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/database-notebook.png)

Procedure: Configure a connection using database-specific interface

This procedure describes the general workflow for all supported database types. For database-specific procedures, refer to the linked types in [Supported databases](supported-database-types.html).

1. Make sure your database instance is configured to accept incoming connections from the following IP address:

```
63.33.83.29
```

> **Note:**
> If you are using Datalore On-Premises, its IP address is different. Contact your Datalore administrator for details.

2. In the New database connection dialog, select a database type.

![New database connection dialog](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/nb_dialog.png)

You will be forwarded to the General tab of the New [database_type_name] connection dialog.

3. On the General tab, fill in the fields to provide details required for the selected database type.

![General tab of Database connection dialog](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/general_tab.png)

> **Note:**
> Find database-specific procedures for the linked types in [Supported databases](supported-database-types.html).

4. (Optional) To configure SSH tunneling for your new connection, perform [this procedure](#SSH).

5. (Optional) To configure the database introspection scope, perform [this procedure](#configure-database-introspection-scope).

6. (Optional) To configure additional parameters for your connection, perform [this procedure](#manage-additional-parameters-for-your-connection).

7. Click the Test connection button at the bottom of the dialog.

8. Once successfully tested, click the Create and close button.

Procedure: Use the legacy connection method

If you encounter issues with connectivity, OAuth authorization, or custom JDBC options when connecting to PostgreSQL, Amazon Redshift, MySQL, MariaDB, Microsoft SQL Server, or Snowflake, you can try to switch to the legacy connection method.

To use it, go to the Advanced tab in the New database connection or Edit database connection dialog, and select Use legacy connection method.

Procedure: Enable SSH tunneling

Datalore can create an SSH tunnel based on the parameters you configure in the New [database_type] connection  dialog. This procedure is an optional step of configuring a database connection in the New database connection dialog.

1. Switch to the SSH tab of the New [database_type] connection dialog.

2. Select the SSH checkbox.

3. Provide your connection details in the Host, Port, and User fields.

4. Use one of the two authentication types:

* To use password-based authentication, fill in the Password field.

* To use a key pair: 1. Expand the Authentication type list and select Key pair. 2. Under Key pair, expand the list and select one of the key pairs you [created for this workspace](ssh-keys-in-workspace.html).

![Enabling SSH tunneling](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/config_ssh.png)

5. Click the Create and close button to finish your work in the dialog, or switch to another tab to continue configuring the connection.

Procedure: Configure database introspection scope

This procedure is an optional step of configuring a database connection in the New database connection dialog.

1. Switch to the Schemas tab of the New [database_type] connection dialog.

2. Select or deselect schemas for introspection.

![Configuring database schemas](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/conf_schema.png)

3. Click Create and close to finish your work in the dialog, or switch to another tab to continue creating the connection.

Procedure: Manage additional parameters for your connection

Use the Advanced tab of the database connection dialog to manage additional parameters. For example, you can manage your JDBC driver custom options here or specify your VM options.

1. Switch to the Advanced tab of the dialog.

2. Do one of the following:

* Specify VM options Enter the values in the VM options field. > **Tip:** > To expand the field for multiple lines input hover over the lower right corner, hold down the left mouse button and drag the border to the desired size.

* Add a parameter Click Add key-value pair. Repeat the previous step for each parameter required for your connection.

![Advanced tab of database connection dialog](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/advanced.png)

3. Click Create and close to finish your work in the dialog, or switch to another tab to continue creating the connection.

Procedure: Attach the connection to a notebook

In a workspace:

1. Open the notebook you want to attach the connection to.

2.  If the notebook is not running, start it by clicking `Run | Start machine`.

3.  In the sidebar, select Attached data and switch to the Databases tab.

4.

Enable the toggle in your database connection.

In a notebook:

1.  If the notebook is not running, start it by clicking `Run | Start machine`.

2.  In the sidebar, select Attached data and switch to the Databases tab.

3.

Enable the toggle in your database connection.

## Next steps

* If OAuth authentication was used for this connection, report users and notebook collaborators may be required to provide their credentials to access the database.

* To retrieve and process data from the connected database, use [Query data with SQL cells](sql-cells.html).

* Learn how to manage and delete database connections [in a workspace](databases-as-workspace-resources.html) and [in a notebook](database-connections-on-notebook-level.html).

## Keywords

database, database connection, attach data, data sources, configure connection

