# Connect to a database by importing connection details

Create a database connection by providing connection details in XML format.

Before you begin
: 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.

Procedure: Step 1. Configure a database connection

1. Copy the XML with database connection details to the clipboard.

2. Open the New database connection dialog. The step depends on whether you want to add 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. You will see the list of all database connections available from the respective workspace.

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)

3. In the New database connection dialog, switch to the Import XML tab.

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

The tab looks like this:

![Import XML tab](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/import_xml.png)

4. Click the Import from clipboard button. This will process the provided data and open the connection dialog for the respective database type with all the fields pre-filled.

5. Provide the missing details, for example, the password.

![Database connection dialog after importing XML](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/post_xml.png)

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

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

Procedure: Step 2. 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.

## Results

* 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, import connection details, connection details in XML, import XML

