# MySQL

This procedure explains how to configure a MySQL database connection.

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: Configure a MySQL database connection

1. Open the New MySQL connection dialog.

In a workspace:

1.  In the sidebar on the Home page, select the workspace where you want to create the 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.

4.

In the dialog, select ![Mysql](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/mysql.svg) MySQL.

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

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)

4.

In the dialog, select ![Mysql](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/mysql.svg) MySQL.

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

2. On the General tab, select the connection type.

* default: to connect by specifying the Host, Port, and Database.

* URL only: to connect by providing the URL of a pre-built connection. > **Note:** > Use this method to pass additional parameters. For example, add `&SSL=true` to the URL string to enable SSL.

3. Proceed based on the selected connection type:

default:

1. In the Host field, type your server address.

2. In the Port field, type the port. The default port is 3306.

> **Note:**
> Real port numbers might be different on your system. Verify that you use a correct port number with your database administrator, server settings, or hosting provider.

3. Under Authentication, select an authentication method:

* User & Password: to use your login and password

* No auth: to connect without authentication required

4. In the User and Password fields, specify your credentials if required by the selected authentication method.

5. In the Database field, type the database name to which you want to connect.

URL only:

1. Under Authentication, select an authentication method:

* User & Password: to use your login and password

* No auth: to connect without authentication required

2. In the User and Password fields, specify your credentials if required by the selected authentication method.

3. In the URL field, provide the URL of the pre-built connection you want to establish.

4. (Optional) For other options (SSH tunneling, scope inspection, or additional connection parameters), switch to the respective tab of the dialog and follow one of [these procedures](configure-a-database-connection.html).

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

6. Once the connection is successfully tested, click the Create and close button.

Procedure: Attach the connection to a notebook

In a workspace:

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

2.  In the sidebar, select ![Attach](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/attach.svg) (Attached data) and switch to the Databases tab.

3. Enable the toggle in your database connection.

In a notebook:

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

2. Enable the toggle in your database connection.

## Next steps

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

* 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).

