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

# DataGrip

> DataGrip supports querying both internal data and external data in the database.

DataGrip supports querying both internal data and external data in the database.

**Tip**

[DataGrip docs](https://www.jetbrains.com/help/datagrip/getting-started.html)

You can connect to the database from DataGrip using either the native StarRocks JDBC driver (recommended) or the MySQL driver.

## Connect using the StarRocks JDBC driver (recommended)

The StarRocks JDBC driver provides accurate metadata discovery, which enables schema browsing, auto-complete, and table introspection in DataGrip.

### Prerequisites

Download the StarRocks JDBC driver JAR. See [StarRocks JDBC Driver](/documents/4.2/integrations/JDBC_driver.md) for download instructions.

### Steps

1. In DataGrip, go to **File** > **Data Sources** (or click the **Database** icon in the toolbar).

2. Click **+** and select **Driver and Data Source**.

3. In the **Drivers** tab, click **+** to create a new driver.

   * Set the **Name** to `StarRocks`.
   * Under **Driver Files**, click **+** and add the StarRocks JDBC driver JAR you downloaded.
   * Set the **Class** to `com.starrocks.cj.jdbc.Driver`.
   * Set the **URL template** to one of:
     ```
     jdbc:starrocks://{host}:{port}
     jdbc:starrocks://{host}:{port}/{database}
     ```
   * Click **OK** to save the driver.

   ![DataGrip - StarRocks driver configuration](https://mintcdn.com/mirrorship-docs/8gpPdHU-sBXASb5i/documents/images/13e0b9f63caff2cde15496f4.png?fit=max\&auto=format\&n=8gpPdHU-sBXASb5i\&q=85\&s=4fdd62d24d7a0866f6dc1d849f628f2a)

4. Back in the **Data Sources** tab, click **+** and select the **the database** driver you just created.

5. Configure the connection settings:

   * **Host**: the FE host IP address of your cluster.
   * **Port**: the FE query port of your cluster, for example, `9030`.
   * **Database**: the database to connect to, in the format `[{catalog_name}.]{database_name}`. Both internal and external catalogs are supported. If the catalog is omitted, `default_catalog` is used.
     * `catalog_name`: the name of the target catalog in your StarRocks cluster.
     * `database_name`: the name of the target database in your StarRocks cluster.
   * **User**: the username to log in to your cluster, for example, `admin`.
   * **Password**: the password to log in to your cluster.

6. Click **Test Connection** to verify the settings, then click **OK**.

**Note**

After connecting, DataGrip only loads the database list. Tables are not fetched until you right-click the database in the sidebar and select **Refresh**. This is expected behavior.

### Browse catalogs and databases in the sidebar

After connecting, there are two ways to control what appears in the left sidebar:

**Option 1 — Use the URL to scope directly to one catalog/database (simplest)**

Edit the **URL** field to include `catalog.database` as shown in the tip above. DataGrip will display that catalog and database in the sidebar immediately, with no further configuration.

**Option 2 — Select schemas in data source properties (multiple catalogs/databases)**

1. Double-click the data source (or right-click > **Properties**).
2. Go to the **Schemas** tab.
3. Check the catalogs and databases you want visible in the sidebar.
4. Click **OK**. DataGrip will refresh and display your selection.

## Connect using the MySQL driver

The MySQL driver is a fallback for the StarRocks JDBC driver.

Create a data source in DataGrip. Note that you must select MySQL as the data source.

![DataGrip - 1](https://mintcdn.com/mirrorship-docs/8FakUMFrFjmoxRt5/documents/images/e326b67a6d152ac46f591af0.png?fit=max\&auto=format\&n=8FakUMFrFjmoxRt5\&q=85\&s=453351a7ecc5bcdc3ab331a02c340908)

![DataGrip - 2](https://mintcdn.com/mirrorship-docs/sL46GVQByWEibCzI/documents/images/495d4d1ad4a94c4d40fd0493.png?fit=max\&auto=format\&n=sL46GVQByWEibCzI\&q=85\&s=fa52f6b0f65222a6e986b281ce259446)

The parameters that you need to configure are described as follows:

* **Host**: the FE host IP address of your cluster.
* **Port**: the FE query port of your cluster, for example, `9030`.
* **Authentication**: the authentication method that you want to use. Select **Username & Password**.
* **User**: the username that is used to log in to your cluster, for example, `admin`.
* **Password**: the password that is used to log in to your cluster.
* **Database**: the data source that you want to access in your cluster. The value of this parameter is in the `<catalog_name>.<database_name>` format.
  * `catalog_name`: the name of the target catalog in your cluster. Both internal and external catalogs are supported.
  * `database_name`: the name of the target database in your cluster. Both internal and external databases are supported.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.