Connect MySQL to DataGrip by supplying JDBC URL, host, port, credentials, and testing the connection.
Install DataGrip 2023.2+, have MySQL server running, and note the host, port (default 3306), user, and password. Download the MySQL JDBC driver if DataGrip doesn’t auto-resolve it.
Open DataGrip → Database tool window → “+” → Data Source → MySQL. The “Data Sources & Drivers” dialog appears.
Enter Host, Port, User, Password, and Database.Optionally enable SSL or SSH tunnel under the “SSH/SSL” tab.
DataGrip auto-generates the URL. Custom format: jdbc:mysql://host:port/database?user=<user>&password=<pass>&serverTimezone=UTC
. Paste it in the URL box when you need advanced parameters.
Click “Test Connection.” Green means success. Fix driver or firewall issues if red.Click “OK” to save.
Right-click the new data source → “New” → “SQL Console.” Write queries like SELECT * FROM Customers LIMIT 10;
and press ⌘↵/Ctrl+Enter to execute.
Set “Keep-alive” interval under Advanced settings, use SSH tunnels for remote servers, store credentials in DataGrip’s password vault, and version-control your DataGrip project files.
.
No. DataGrip bundles a console. You only need the MySQL JDBC driver, which DataGrip can download automatically.
Yes. In the data-source dialog, open “SSH/SSL,” enable SSL, select “Verify CA,” and provide the CA certificate.
Right-click the data source → “Database Tools” → “Copy Settings.” Share the .idea
folder or use JetBrains Space to sync settings.