DataGrip, developed by JetBrains, is an integrated development environment (IDE) specifically designed for database management and SQL development. It helps database developers and data analysts efficiently manage and query databases, write complex SQL queries, and perform database design and maintenance. This guide demonstrates how to connect to DataGrip using the MySQL-compatible tenant of an transactional instance in OceanBase Cloud.
Prerequisites
You have downloaded and installed DataGrip. For more information, visit the DataGrip official website.
You have registered for an OceanBase Cloud account and created a transactional instance with a MySQL-compatible tenant. For more information, refer to Create an instance and Create a tenant.
Note
We recommend selecting OceanBase Database version 4.2.4 or later when creating an OceanBase Cloud instance to ensure better integration.
Procedure
Step 1: Obtain an OceanBase Cloud connection string
Log in to the OceanBase Cloud console. On the Instances page, expand the target instance and select Connect > Get Connection String under the target tenant.
In the pop-up window, click Connect with Public IP.
In the Connect with Public IP window, complete the following settings to generate the connection string:
Under 1. Add an IP address to the allowlist, click Add to add your exit IP address(es) used for the connection to the allowlist.
(Optional) Under 2. Download the CA certificate to connect securely to the tenant, download the CA certificate and complete the verification.
Under 3. Connect to your instance, click the drop-down list for Database and Account to create a database and an account for the connection. Select MySQL CLI as the connection method.
Notice
Please keep your password in a secure place after creating your account.
Step 2: Create an OceanBase Cloud data source in DataGrip
If you're using DataGrip for the first time, open DataGrip and click New Project to create a new project.
In the newly created project, click the
icon at the top of the page to open the Database Explorer panel.In the Database Explorer, click + at the top left and select Data Source > MySQL > MySQL.
In the Data Sources window, configure the following settings using the connection string obtained in Step 1:
Configuration Item Description Name A custom name for the data source. Host Taken from the -hparameter in the connection string, which is the hostname of OceanBase Cloud database, for example,t5******.aws-ap-southeast-1.oceanbase.cloud.User Taken from the -uparameter in the connection string, which is the account name, for example,test.Password Taken from the -pparameter in the connection string, which is the account password.Port Taken from the -Pparameter in the connection string, which is the OceanBase Cloud database connection port.Database Taken from the -Dparameter in the connection string, which is the name of the database to be accessed.Click Test Connection to verify if the connection is successful.
Once the connection is successfully established, click OK to complete the process.
What's next
After the connection is established, you can start using DataGrip. For detailed instructions on how to use DataGrip, refer to the DataGrip official documentation.