Master DataGrip: Essential Tips for Efficient MySQL & MongoDB Management
This guide walks you through downloading DataGrip, configuring its appearance, creating MySQL and MongoDB data sources, managing tables, applying powerful SQL editing shortcuts, and leveraging export and execution‑plan features to write higher‑quality database code.
Download
Download DataGrip from the official JetBrains website: https://www.jetbrains.com/datagrip/
Appearance Settings
Adjust the IDE font size via
File->Settings→ Appearance & Theme, and the editor font size via
Editor->Font.
Create Data Source
To work with a database, first create a data source. Click the plus sign →
Data Source->MySQL, fill in the connection details, and add the missing
serverTimezoneparameter (e.g.,
Asia/Shanghai) in the Advanced options before testing the connection.
Table Management
After a successful connection, all tables appear in the left pane.
Right‑click a table →
Modify Tableto view its definition.
Double‑click a table to browse its data with pagination.
Hide unwanted columns via the column‑header context menu.
Use the filter bar to write
WHEREclauses for data filtering.
Right‑click the database name →
New Tableto create a table, add columns, and preview the generated SQL.
Export data to CSV, HTML, Excel, JSON, and other formats.
SQL Editing Tips
Open a query console with Right‑click →
Open Query Console.
Enjoy intelligent code completion for tables, columns, and SQL keywords.
Replace
*with explicit columns by selecting
*and pressing
Alt+Enter.
When a table alias is used, press
Alt+Enterto prepend the alias to all selected columns.
For
INSERT INTOstatements, use the intention action to generate the column list automatically.
Hover over functions to see detailed documentation.
Format SQL with
Ctrl+Alt+L.
View execution logs and local history via Right‑click →
Local History->Show History.
Run
Explain Plainon a statement to view its execution plan.
MongoDB Support
Create a MongoDB data source via the plus sign →
Data Source->MongoDB, configure the connection, test it, browse collections, set filter conditions, and insert documents.
Conclusion
This guide covers the most common operations and handy shortcuts for managing MySQL and MongoDB databases with DataGrip, enabling users familiar with other JetBrains tools to become productive quickly.
macrozheng
Dedicated to Java tech sharing and dissecting top open-source projects. Topics include Spring Boot, Spring Cloud, Docker, Kubernetes and more. Author’s GitHub project “mall” has 50K+ stars.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.