DataGrip is compatible with AnalyticDB for MySQL. This page covers the test environment used for verification and the database operations confirmed to work with DataGrip.
Test environment
| Component | Version |
|---|---|
| MySQL JDBC driver | mysql-connector-java-8.0.15 |
| DataGrip | Download DataGrip |
Verified operations
The following operations were tested and confirmed to work with AnalyticDB for MySQL in DataGrip.
Test connectivity
Configure the AnalyticDB for MySQL data source in DataGrip with the following settings:
Connection type: default
Driver: MySQL
Host: AnalyticDB for MySQL instance endpoint
Port:
3306Authentication: User & Password
User:
testDatabase:
adb_demo
Click Test Connection — a green "Succeeded" status confirms the connection.
List databases
Run show databases; in the SQL console. The result returns the following databases: MYSQL, ADB_External_TPCH_10GB, adb_demo, INFORMATION_SCHEMA.
To display all schemas, select Properties in the connection configuration.
Create a table
Execute the following CREATE TABLE statement in the SQL editor. The table test3 includes four columns — id int, name string, age int, and dt string — with id as the primary key and DISTRIBUTED BY HASH(id) as the distribution policy. After execution, test3 appears alongside test, test1, and test2 under adb_demo in the database explorer.
List all tables
show tables;
Query the schema of a table
Run show create table test3; to view the table definition. The result shows that test3 contains two columns: id (int, primary key) and age (int), with distribution policy DISTRIBUTE BY HASH(id), storage policy HOT, and engine YUANWU.
Write data to a table
INSERT INTO test3 (id, age) VALUES ('5', '20')
adb_demo> INSERT INTO test3 (id, age) VALUES ('5', '20')
[2025-01-16 15:36:10] 1 row affected in 554 ms
adb_demo> INSERT INTO test3 (id, age) VALUES ('5', '20')
[2025-01-16 15:36:24] 1 row affected in 18 ms
adb_demo> INSERT INTO test3 (id, age) VALUES ('5', '20')
Query data from a table
Run select * from test; in the SQL console to verify the inserted data. The result returns 4 rows with columns id, name, age, and dt: (2, Tom, 20, Basketball), (3, Jack, 30, Volleyball), (1, Lili, 10, Soccer), (4, Lucy, 40, Badminton).
Create a view
create view test_view2 as select * from test;
-- Output log --
adb_demo> INSERT INTO test3 (id, age) VALUES ('5', '20')
[2025-01-16 15:36:28] 1 row affected in 20 ms
adb_demo> select * from test
[2025-01-16 15:37:29] 4 rows retrieved starting from 1 in 462 ms (execution: 49 ms, fetching: 413 ms)
adb_demo> create view test_view as select * from test
[2025-01-16 15:40:05] completed in 1 s 56 ms
adb_demo> create view test_view2 as select * from test
[2025-01-16 15:42:18] completed in 94 ms
Query data from a view
Run select * from test_view2; to query the view. The result returns 4 rows with columns ID, NAME, AGE, and DT, confirming the view was created successfully.