# Cannot connect to a database

## Step 1. Check your network settings

Databases can work locally, on a server, or in the cloud. For server and cloud databases, you need a network connection. To verify that the connection is available, use ping and  telnet commands.

With the ping command, you can ensure that the destination computer is reachable from the source computer. Open a command line and type the following command: `ping -a <host_IP>`, where `-a` is a command option that resolves addresses to hostnames (if it is possible). If you use hostnames with the ping command, a hostname is resolved to the IP address. For example, `ping -a example.com` resolves to `PING example.com (93.184.216.34)`.

```
ping -a <host_IP>
```

![Test connection with the ping command](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_test_connection_with_ping.png)

With the telnet command, you can test connectivity to remote computers and issue commands. If you specify a port as a parameter for the `telnet` command, you can test connectivity to a remote host on the given port. If the connection is successful, you see the message: `Connected to <host_IP>`.

```
telnet <host_IP> <port_number>
```

![Test connection with the telnet command](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_test_connection_with_telnet.png)

> **Note:**
> For security reasons, DBMS usually drops all telnet connections. The telnet command allows you to check if the port is opened for communication.

## Step 2. Check your connection properties

Each database (MySQL, PostgreSQL, Oracle, or any other vendor) has its own connection settings. Most databases include the connection settings:

* Host: A hostname of a computer or another device that stores a database. It can be an IP address `127.0.0.1` or a domain name `localhost`.

* Database: A name of the database to which you want to connect. You can find the database name in the settings of your database server, or you can ask your database administrator. In some cases, it is possible to run a query in a database command line to see the names of all available databases. For example, in MySQL you can run `SHOW DATABASES;`. ![The SHOW DATABASES query](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_troubleshooting_show_databases.png)

* User: A name of a user that has enough privileges to perform actions with a database. Run a query in a database command line to see the names of all available databases. For example, in MySQL you can run `SHOW GRANTS;`. ![The SHOW GRANTS query](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_troubleshooting_show_grants.png)

* Password: A password of the user.

* Port: A number that identifies a connection point between hosts. Hosts use port numbers to determine to which application, service, or process a connection must be established. Different database vendors use different ports for their databases. The following list is a list of default port numbers. | Vendor | Default port | | --- | --- | | Amazon Redshift | 5439 | | Apache Derby | 1527 | | Apache Cassandra | 9042 | | Apache Hive | 10000 (Hive Server2) or 9083 (Hive Metastore) | | Azure SQL Database | 1433 | | ClickHouse | 8123 | | Couchbase Query Service Query Service | 11210 | | Exasol | 8563 | | Greenplum | 5432 | | H2 | 8082 | | HSQLDB | 9001 | | IBM Db2 LUW | 50000 | | MariaDB | 3306 | | Microsoft SQL Server | 1433 (TCP), 1434 (UDP might be required) | | MySQL | 3306 | | Oracle | 1521 | | PostgreSQL | 5432 | | Snowflake | 443 | | SQLite | None | | Sybase ASE | 5000 | | Vertica | 5433 | > **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.

Verify that the connection settings for the selected data source are correct. For more information about creating and changing a data source, refer to [Create a data source](managing-data-sources.html#create_a_data_source) and [Sessions](managing-connection-sessions.html).

## Step 3. Check the driver version

With a JDBC driver, you can interact with a database management system (DBMS) from IntelliJ IDEA. Each DBMS requires its own JDBC driver. Ensure that the driver version and the DBMS version are compatible with each other.

From IntelliJ IDEA, you can download drivers for all supported vendors. You can check the full list of supported vendors in the Drivers list . Alternatively, you can add your own driver to an existing vendor, or create a new driver entry for the vendor that is not on the Drivers list.

To open the Drivers list, in the   Database   tool window  ( `View  | Tool Windows |  Database` ), click the Data Source Properties icon ![The Data Source Properties icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/database-plugin.icons.expui.manageDataSources.svg) or press   `Shift+Enter` (Windows), `⌘ I` (macOS), `⇧ ⏎` (IntelliJ IDEA Classic (macOS)), `⌘ I` (macOS System Shortcuts), `Shift+Enter` (XWin), `Shift+Enter` (GNOME), `Shift+Enter` (KDE), `Shift+Enter` (Emacs), `Shift+Enter` (Sublime Text), `⌘ I` (Sublime Text (macOS)), `Shift+Enter` (NetBeans), `Shift+Enter` (Visual Studio), `⌘ I` (Visual Studio (macOS)), `Shift+Enter` (Eclipse), `⌘ I` (Eclipse (macOS)) .

Procedure: Download a driver and select the driver version

To download drivers from the JetBrains FTP server, select a vendor from the Drivers  list, and click the Download ver. <version_number> link in the Driver files pane.

To change the driver version, click the ver. <version_number> link in the Driver files pane and select the driver version that you need.

![The Driver list and driver settings](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_download_driver_select_driver_version.png)

Procedure: Using user driver files

1. Open data source properties by doing one of the following:

* On the Database tool window toolbar, click ![The Data Sources icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/database-plugin.icons.expui.manageDataSources.svg) Data Sources.

* Press `Shift+Enter` (Windows), `⌘ I` (macOS), `⇧ ⏎` (IntelliJ IDEA Classic (macOS)), `⌘ I` (macOS System Shortcuts), `Shift+Enter` (XWin), `Shift+Enter` (GNOME), `Shift+Enter` (KDE), `Shift+Enter` (Emacs), `Shift+Enter` (Sublime Text), `⌘ I` (Sublime Text (macOS)), `Shift+Enter` (NetBeans), `Shift+Enter` (Visual Studio), `⌘ I` (Visual Studio (macOS)), `Shift+Enter` (Eclipse), `⌘ I` (Eclipse (macOS)) .

![Open the Data Source and Drivers dialog](https://resources.jetbrains.com.cn/help/img/idea/2026.2/open_data_sources_and_drivers_dialog.png)

2. In the Data Sources and Drivers dialog, ensure that you are on the Drivers tab.

3. In the Data Sources and Drivers dialog, click the Add icon (![The Add icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.add.svg)).

4. In the Name field, type the name of the driver.

5. In the Driver Files pane, click the Add icon (![The Add icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.add.svg)) and select Custom JARs… .

6. Navigate to the JAR file of the JDBC driver, select it, and click OK.

7. In the Class field, specify the value that you want to use for the driver.

8. Click Apply.

9. To create a data source from the driver's dialog, click Create Data Source.

[Video](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_create_user_driver_connection.mp4)

Procedure: Configure a JDBC driver for an existing data source

You can add libraries to the existing driver or replace the driver completely.

To work properly, some JDBC drivers require a path to library files along with the driver.  For more information about library paths, refer to  [Library paths for user drivers](other-databases.html#library-paths-for-user-drivers).

1. Open data source properties by doing one of the following:

* On the Database tool window toolbar, click ![The Data Sources icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/database-plugin.icons.expui.manageDataSources.svg) Data Sources.

* Press `Shift+Enter` (Windows), `⌘ I` (macOS), `⇧ ⏎` (IntelliJ IDEA Classic (macOS)), `⌘ I` (macOS System Shortcuts), `Shift+Enter` (XWin), `Shift+Enter` (GNOME), `Shift+Enter` (KDE), `Shift+Enter` (Emacs), `Shift+Enter` (Sublime Text), `⌘ I` (Sublime Text (macOS)), `Shift+Enter` (NetBeans), `Shift+Enter` (Visual Studio), `⌘ I` (Visual Studio (macOS)), `Shift+Enter` (Eclipse), `⌘ I` (Eclipse (macOS)) .

![Open the Data Source and Drivers dialog](https://resources.jetbrains.com.cn/help/img/idea/2026.2/open_data_sources_and_drivers_dialog.png)

2. Click the Driver link in data source settings and select Go to Driver.

3. Click the provided driver entry, and click Remove (![the Remove button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.remove.svg)).

To revert changes, click the Roll back Changes icon (![the Roll back Changes icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.diff.revert.svg)) that is in the lower-right part of the window.

4. In the Driver Files pane, click the Add icon (![The Add icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.add.svg)) and select Custom JARs….

5. In the file browser, navigate to the JAR file of the JDBC driver, select it, and click OK.

6. In the Class field, specify the value that you want to use for the driver.

Driver class is a driver-specific main class for a JDBC driver. For the proper driver class for the JDBC driver you use, refer to the driver's documentation.

> **Note:**
> If the field is empty, or a predefined value is different from the one your driver requires, specify the required value manually.

7. If your custom driver requires an additional property, go to the Advanced tab in the dialog. In the properties pane, enter the additional property's name and value in the last row of Name and Value columns, where <user defined> and <value> are shown.

8. Click Apply.

> **Tip:**
> For more information about about JDBC driver settings, refer to  [the dialog reference topic](data-sources-and-drivers-dialog.html#driver).

[Video](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_add_user_driver_to_connection.mp4)

## Step 4. (Windows only) Check the temp directory path for non-ASCII characters

Currently, the temp directory path should not contain non-ASCII characters. If it does, you can fix the issue by doing one of the following:

* Open the Windows Control Panel and navigate to `Settings | Time & Language | Language | Administrative language settings` or `Settings | Time & language | Language & region | Administrative language settings` for Windows 10. In the Language for non-Unicode programs section, change the language to your local one.

* For Java to use another temp directory path that contains only ASCII characters, in the IDE, go to `Help | Edit custom VM Options` and add `-Djava.io.tmpdir=<ASCII_characters_only_temp_directory_path>` to the `idea.vmoptions` file.

## Step 5. Check if the connection with SSH or SSL is required

To make a connection to a database more secure, some services require SSH or SSL usage.

### SSL

The following procedure describes the SSL configuration that suits most databases. For some databases, you need to use another approach for a successful connection.  You can see configuration examples for [Cassandra](https://www.jetbrains.com.cn/en-us/help/datagrip/how-to-connect-to-cassandra-with-ssl.html) and [Heroku Postgres](https://www.jetbrains.com.cn/en-us/help/datagrip/how-to-connect-to-heroku-postgres.html) in the DataGrip documentation.

Procedure: Connect to a database with SSL

1. Open data source properties by doing one of the following:

* On the Database tool window toolbar, click ![The Data Sources icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/database-plugin.icons.expui.manageDataSources.svg) Data Sources.

* Press `Shift+Enter` (Windows), `⌘ I` (macOS), `⇧ ⏎` (IntelliJ IDEA Classic (macOS)), `⌘ I` (macOS System Shortcuts), `Shift+Enter` (XWin), `Shift+Enter` (GNOME), `Shift+Enter` (KDE), `Shift+Enter` (Emacs), `Shift+Enter` (Sublime Text), `⌘ I` (Sublime Text (macOS)), `Shift+Enter` (NetBeans), `Shift+Enter` (Visual Studio), `⌘ I` (Visual Studio (macOS)), `Shift+Enter` (Eclipse), `⌘ I` (Eclipse (macOS)) .

![Open the Data Source and Drivers dialog](https://resources.jetbrains.com.cn/help/img/idea/2026.2/open_data_sources_and_drivers_dialog.png)

2. On the  Data Sources  tab, select a data source that you want to modify.

3. Click the SSH/SSL tab and select the Use SSL checkbox.

4. In the CA file field, navigate to the CA certificate file (for example, `mssql.pem`).

5. You can leave the certificate file fields empty and use a truststore to obtain a required certificate from the certificates that it contains. To do that, tick the Use truststore checkbox and select the truststore that you want to use.

* IDE: Use the certificates that are accepted by the IDE. You can add new accepted certificates in `Settings | Appearance & Behavior | System Settings | Server Certificates`.

* JAVA: Use JAVA truststore certificates.

* System: Use System truststore certificates.

6. In the Client certificate file field, navigate to the client certificate file (for example, `client-cert.pem`).

7. In the Client key file field, navigate to the client key file (for example, `client-key.pem`).

8. From the Mode list, select the verification mode:

|  |  |
| --- | --- |
|  Require  | Verifies that the server recognizes the client certificate, if the certificate is provided. |
| Verify CA |      * Verifies that the server recognizes the client certificate, if the certificate is provided.    * Verifies the server by checking the certificate chain up to the root certificate that is stored on the client.    |
| Full Verification |      * Verifies that the server recognizes the client certificate, if the certificate is provided.    * Verifies the server by checking the certificate chain up to the root certificate that is stored on the client.    * Verifies the server host to ensure that it matches the name stored in the server certificate.    |

The SSL connection fails if either one of the certificates cannot be verified.

9. To ensure that the connection to the data source is successful, click Test Connection.

![Connect to a database with SSL](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_connect_with_ssl.png)

> **Note:**
> It is recommended to use PEM certificates.

> **Note:**
> With self-signed certificates and in some cases with certificates issued by the trusted root entity, you might experience errors when you use the latest JDBC driver version. The SSL connection might fail if your Java keystore does not accept the certificate chains. As a temporary solution, try to downgrade the JDBC driver (for example, for the MySQL connector, you need to switch to the 5.1.40 version.)

Procedure: Disable SSL connection to a database

1. Open data source properties by doing one of the following:

* On the Database tool window toolbar, click ![The Data Sources icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/database-plugin.icons.expui.manageDataSources.svg) Data Sources.

* Press `Shift+Enter` (Windows), `⌘ I` (macOS), `⇧ ⏎` (IntelliJ IDEA Classic (macOS)), `⌘ I` (macOS System Shortcuts), `Shift+Enter` (XWin), `Shift+Enter` (GNOME), `Shift+Enter` (KDE), `Shift+Enter` (Emacs), `Shift+Enter` (Sublime Text), `⌘ I` (Sublime Text (macOS)), `Shift+Enter` (NetBeans), `Shift+Enter` (Visual Studio), `⌘ I` (Visual Studio (macOS)), `Shift+Enter` (Eclipse), `⌘ I` (Eclipse (macOS)) .

![Open the Data Source and Drivers dialog](https://resources.jetbrains.com.cn/help/img/idea/2026.2/open_data_sources_and_drivers_dialog.png)

2. On the  Data Sources  tab, select a data source that you want to modify.

3. Click the SSH/SSL tab and clear the Use SSL checkbox.

4. Click Apply.

Procedure: Copy SSL settings from other data sources

If you configured SSL settings for one data source, you can copy them for another data source.

1. Open data source properties by doing one of the following:

* On the Database tool window toolbar, click ![The Data Sources icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/database-plugin.icons.expui.manageDataSources.svg) Data Sources.

* Press `Shift+Enter` (Windows), `⌘ I` (macOS), `⇧ ⏎` (IntelliJ IDEA Classic (macOS)), `⌘ I` (macOS System Shortcuts), `Shift+Enter` (XWin), `Shift+Enter` (GNOME), `Shift+Enter` (KDE), `Shift+Enter` (Emacs), `Shift+Enter` (Sublime Text), `⌘ I` (Sublime Text (macOS)), `Shift+Enter` (NetBeans), `Shift+Enter` (Visual Studio), `⌘ I` (Visual Studio (macOS)), `Shift+Enter` (Eclipse), `⌘ I` (Eclipse (macOS)) .

![Open the Data Source and Drivers dialog](https://resources.jetbrains.com.cn/help/img/idea/2026.2/open_data_sources_and_drivers_dialog.png)

2. On the  Data Sources  tab, select a data source that you want to modify.

3. Click the SSH/SSL tab and select the Use SSL checkbox.

4. Click the Copy from… link and select the configuration that you want to copy.

### SSH

Secure Shell or SSH is a network protocol that is used to encrypt a connection between a client and a server.

In IntelliJ IDEA, you can create an SSH connection one of the following ways:

* [Using the IntelliJ IDEA SSH tunnel.](#ssh_tunnel) The IDE will create an SSH tunnel using the SSH configuration that you set.

* [Creating an SSH tunnel manually using PuTTy, Pageant, or ssh-client.](#ssh_tunnel_manually)

#### IntelliJ IDEA SSH tunnel

IntelliJ IDEA can create an SSH tunnel based on the SSH configuration that you set. To access the SSH configuration settings,  press `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) to open settings and select Tools | SSH Configuration .

To use an SSH tunnel for the data source, select the Use SSH tunnel checkbox in the SSH/SSL tab of   Data Sources and Drivers  dialog (  `Shift+Enter` (Windows), `⌘ I` (macOS), `⇧ ⏎` (IntelliJ IDEA Classic (macOS)), `⌘ I` (macOS System Shortcuts), `Shift+Enter` (XWin), `Shift+Enter` (GNOME), `Shift+Enter` (KDE), `Shift+Enter` (Emacs), `Shift+Enter` (Sublime Text), `⌘ I` (Sublime Text (macOS)), `Shift+Enter` (NetBeans), `Shift+Enter` (Visual Studio), `⌘ I` (Visual Studio (macOS)), `Shift+Enter` (Eclipse), `⌘ I` (Eclipse (macOS)) ) .

> **Note:**
> In most cases, you do not need to modify the General tab settings after setting the SSH configuration in SSH/SSL tab, as IntelliJ IDEA will connect to the local end of the SSH tunnel. The exception is when you create an SSH tunnel manually. In this case, as Host on the General tab, you need to set the IP address of your server in an isolated network.
>
>
>
> Upon the connection, the SSH tunnel hostname is resolved on the machine with SSH server, as the server establishes connection to a database.

All created SSH connections are shared between all the data sources that you have in a project. If you do not want to share a connection between projects, select the Visible only for this project checkbox in the SSH connection settings.

Procedure: Connect to a database with SSH

1. Open data source properties by doing one of the following:

* On the Database tool window toolbar, click ![The Data Sources icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/database-plugin.icons.expui.manageDataSources.svg) Data Sources.

* Press `Shift+Enter` (Windows), `⌘ I` (macOS), `⇧ ⏎` (IntelliJ IDEA Classic (macOS)), `⌘ I` (macOS System Shortcuts), `Shift+Enter` (XWin), `Shift+Enter` (GNOME), `Shift+Enter` (KDE), `Shift+Enter` (Emacs), `Shift+Enter` (Sublime Text), `⌘ I` (Sublime Text (macOS)), `Shift+Enter` (NetBeans), `Shift+Enter` (Visual Studio), `⌘ I` (Visual Studio (macOS)), `Shift+Enter` (Eclipse), `⌘ I` (Eclipse (macOS)) .

![Open the Data Source and Drivers dialog](https://resources.jetbrains.com.cn/help/img/idea/2026.2/open_data_sources_and_drivers_dialog.png)

2. Select a data source for which you want to set up an SSH connection.

3. Click the SSH/SSL tab and select the Use SSH tunnel checkbox.

4. Click ![the Add SSH configuration](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.general.ellipsis.svg) Add SSH configuration.

5. In the SSH Configurations dialog, click the Add button.

6. If you do not want to share the configuration between projects, select the Visible only for this project checkbox.

7. In the Host and Port fields, specify your connection details.

8. Enter your username in the Username field.

9. In this tutorial, we use encrypted private key file and public key file to authenticate. From the Authentication type list, you can select an authentication method:

* Password: Access the host with a password. To save the password in IntelliJ IDEA, select the Save password checkbox.

* Key pair (OpenSSH or PuTTY): Use [SSH authentication](https://www.ssh.com/) with a key pair. To apply this authentication method, you must have a private key on the client machine and a public key on the remote server. IntelliJ IDEA supports private keys that are generated with the [OpenSSH](https://www.openssh.com/) utility. Specify the path to the file where your private key is stored and type the passphrase (if any) in the corresponding fields. To have IntelliJ IDEA remember the passphrase, select the Save passphrase checkbox.

* OpenSSH config and authentication agent: Use a credentials helper application that manages your SSH keys, such as [ssh-agent](https://en.wikipedia.org/wiki/Ssh-agent) or [Pageant (Windows only)](https://the.earth.li/~sgtatham/putty/0.70/htmldoc/Chapter9.html#pageant). > **Tip:** > If you have both OpenSSH ssh-agent and Pageant running, only ssh-agent will be used, even if it does not contain any keys.

10. Click Test Connection to run a test connection.

11. In the SSH Configurations dialog, click OK to confirm the new SSH configuration settings.

12. In the Local port field of Data Sources and Drivers dialog, specify the local port number from which you want to forward the connection. Otherwise, IntelliJ IDEA selects the port dynamically.

13. Click the Test Connection link at the bottom of the connection details area to initiate a test connection to your database.

![Test Connection link](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_test_connection_link.png)

14. Click OK to create the data source.

![SSH settings of a data source](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_ssh_configurations.png)

> **Tip:**
> For more information about working with SSH keys, refer to the [Generating a new SSH key and adding it to the ssh-agent](https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/) tutorial.

##### Examples

For examples of connecting to databases with SSH, refer to the [Connect to a database with SSH](connect-to-a-database-with-ssh.html) topic.

Procedure: Disable SSH connection to a database

1. Open data source properties by doing one of the following:

* On the Database tool window toolbar, click ![The Data Sources icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/database-plugin.icons.expui.manageDataSources.svg) Data Sources.

* Press `Shift+Enter` (Windows), `⌘ I` (macOS), `⇧ ⏎` (IntelliJ IDEA Classic (macOS)), `⌘ I` (macOS System Shortcuts), `Shift+Enter` (XWin), `Shift+Enter` (GNOME), `Shift+Enter` (KDE), `Shift+Enter` (Emacs), `Shift+Enter` (Sublime Text), `⌘ I` (Sublime Text (macOS)), `Shift+Enter` (NetBeans), `Shift+Enter` (Visual Studio), `⌘ I` (Visual Studio (macOS)), `Shift+Enter` (Eclipse), `⌘ I` (Eclipse (macOS)) .

![Open the Data Source and Drivers dialog](https://resources.jetbrains.com.cn/help/img/idea/2026.2/open_data_sources_and_drivers_dialog.png)

2. Select a data source profile where you want to change connection settings.

3. Click the SSH/SSL tab and clear the Use SSH tunnel checkbox.

4. Click Apply.

#### Create SSH tunnel manually

Procedure: Create the SSH tunnel with PuTTY (Windows)

1. Download and run the latest version of the PuTTY SSH and Telnet client (download the client from [https://www.putty.org/](https://www.putty.org/)).

2. In the PuTTY Configuration dialog, navigate to `Connection | SSH | Auth`.

3. In the Private key file for authentication field, specify the path to your private key file and click Open.

4. In the command line window, specify the username that you use for the SSH tunnel and press `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `Enter` (NetBeans), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (Eclipse), `⏎` (Eclipse (macOS)). Do not close the command line window.

5. In the   Database   tool window ,  click the Data Source Properties icon ![the Data Source Properties icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/database-plugin.icons.expui.manageDataSources.svg) on the toolbar.

6. Select a data source profile where you want to change connection settings.

7. Click the SSH/SSL tab and select the Use SSH tunnel checkbox.

8. From the Auth type list, select OpenSSH config and authentication agent.

9. In Proxy host, Proxy user, and Port fields, specify connection details.

10. To ensure that the connection to the data source is successful, click Test Connection.

![Create the SSH tunnel with PuTTY (Windows)](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_putty_key_config.png)

Procedure: Create the SSH tunnel with Pageant (Windows)

Pageant is an SSH authentication agent for PuTTY, PSCP, PSFTP, and Plink. Pageant stores your private key, and as long as it is running, it provides the unlocked private key to PuTTY or other tools like IntelliJ IDEA. You can find the Pageant icon in the Windows taskbar.

1. Download the latest version of Pageant (download the client from [https://www.putty.org/](https://www.putty.org/)).

2. In the Windows taskbar, right-click the Pageant icon and select Add Key.

3. In the Select Private Key File dialog, navigate to the private key file (the PPK file) and click Open.

4. (Optional) Enter the private key passphrase and press `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `Enter` (NetBeans), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (Eclipse), `⏎` (Eclipse (macOS)).

5. In the   Database   tool window ,  click the Data Source Properties icon ![the Data Source Properties icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/database-plugin.icons.expui.manageDataSources.svg) on the toolbar.

6. Select a data source profile where you want to change connection settings.

7. Click the SSH/SSL tab and select the Use SSH tunnel checkbox.

8. From the Auth type list, select OpenSSH config and authentication agent.

9. In Proxy host, Proxy user, and Port fields, specify connection details.

10. To ensure that the connection to the data source is successful, click Test Connection.

![Create the SSH tunnel with Pageant (Windows)](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_task_area_pageant.png)

Procedure: Create the SSH tunnel with the ssh-agent (macOS and Linux)

Run all commands for ssh-agent in the command line.

1. Ensure that ssh-agent is running.

```
ssh-agent
```

2. Add your key to the agent (in the following example, the key path is `~/.ssh/id_rsa`).

```
ssh-add ~/.ssh/id_rsa
```

3. (Optional) On macOS, you can add `-K` option to the `ssh-add` command to store passphrases in your keychain. On macOS Sierra and later, you need to create the `config` file in `~/.ssh/` with the following text:

```
Host *
UseKeychain yes
AddKeysToAgent yes
IdentityFile ~/.ssh/id_rsa
```

If you have other private keys in the `.ssh` directory, add an `IdentityFile` line for each key. For example, if the second key has the `id_ed25519` name, add `IdentityFile ~/.ssh/id_ed25519` as an additional line for the second private key.

4. List all added keys.

```
ssh-add -L
```

5. In the   Database   tool window ,  click the Data Source Properties icon ![the Data Source Properties icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/database-plugin.icons.expui.manageDataSources.svg) on the toolbar.

6. Select a data source profile where you want to change connection settings.

7. Click the SSH/SSL tab and select the Use SSH tunnel checkbox.

8. From the Auth type list, select OpenSSH config and authentication agent.

9. In Proxy host, Proxy user, and Port fields, specify connection details.

10. To ensure that the connection to the data source is successful, click Test Connection.

![Create the SSH tunnel with the ssh-agent (macOS and Linux)](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_ssh_agent_linux_macos.png)

## Step 6. Write to us if you still need help

Procedure: Write to the IntelliJ IDEA team

* Email our team at [idea-support@jetbrains.com](mailto:idea-support@jetbrains.com).   Describe your problem, and attach all available [materials that can speed up troubleshooting](troubleshooting-materials.html) (code samples, screenshots, logs, animations, videos, and other materials).

For more information about other troubleshooting sources, refer to     [Support and assistance](getting-help.html).

## Local database

If your database is running on the same machine as IntelliJ IDEA, do the following:

Procedure:

1. Make sure the database server is installed and running.

2. Check that the database accepts TCP/IP connections.

3. In the   Data Sources and Drivers  dialog (  `Shift+Enter` (Windows), `⌘ I` (macOS), `⇧ ⏎` (IntelliJ IDEA Classic (macOS)), `⌘ I` (macOS System Shortcuts), `Shift+Enter` (XWin), `Shift+Enter` (GNOME), `Shift+Enter` (KDE), `Shift+Enter` (Emacs), `Shift+Enter` (Sublime Text), `⌘ I` (Sublime Text (macOS)), `Shift+Enter` (NetBeans), `Shift+Enter` (Visual Studio), `⌘ I` (Visual Studio (macOS)), `Shift+Enter` (Eclipse), `⌘ I` (Eclipse (macOS)) ) :

1.  Specify `localhost` or `127.0.0.1` in the Host field.

2.  Ensure the port specified in the Port field matches the port configured for the database server.

3.  Verify that the user name, password, and other connection settings are correct.

4.  Make sure the correct [JDBC driver](jdbc-drivers.html) is downloaded and selected in the Driver drop-down.

## Data source in WSL

If your database is in WSL, open the   Data Sources and Drivers  dialog (  `Shift+Enter` (Windows), `⌘ I` (macOS), `⇧ ⏎` (IntelliJ IDEA Classic (macOS)), `⌘ I` (macOS System Shortcuts), `Shift+Enter` (XWin), `Shift+Enter` (GNOME), `Shift+Enter` (KDE), `Shift+Enter` (Emacs), `Shift+Enter` (Sublime Text), `⌘ I` (Sublime Text (macOS)), `Shift+Enter` (NetBeans), `Shift+Enter` (Visual Studio), `⌘ I` (Visual Studio (macOS)), `Shift+Enter` (Eclipse), `⌘ I` (Eclipse (macOS)) )  and make sure the Environment field is set to Dev Container.

![The Environment data source setting for a data source in WSL](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_data_source_in_wsl_environment_setting.png)

