How to Connect MariaDB to DataGrip

Galaxy Glossary

How do I connect MariaDB to DataGrip?

Create a stable MariaDB JDBC data source in JetBrains DataGrip with the correct driver, URL, credentials, and optional SSL.

Sign up for the latest in SQL knowledge from the Galaxy Team!
Welcome to the Galaxy, Guardian!
Oops! Something went wrong while submitting the form.

Description

Table of Contents

What prerequisites must be in place?

Install DataGrip 2023.3+ and ensure the MariaDB (or MySQL) JDBC driver is downloaded. Collect the database host, port (3306), user, password, and default schema.

How do I add the MariaDB driver if it is missing?

Open File → Data Sources & Drivers, click Drivers, select MariaDB, and press Download. DataGrip stores the JAR under ~/.DataGrip*/jdbc-drivers/.

How do I create the data source?

Inside Data Sources & Drivers click +MariaDB. Enter host, port, user, password, and database.Enable Save password to avoid re-prompting.

What connection URL should I use?

The JDBC URL appears as jdbc:mariadb://db.acme.com:3306/shop?serverTimezone=UTC. Add optional parameters like allowMultiQueries=true or useSSL=true when security is required.

How do I test and save the connection?

Click Test Connection. DataGrip pings the server and loads metadata. Green status means success. Press ApplyOK to store the data source for future sessions.

What sample query verifies the schema?

Run SELECT id, name, email FROM Customers ORDER BY created_at DESC LIMIT 10;.If rows return, privileges are correct.

How do I use SSL or SSH tunneling?

In the data-source dialog, open the SSH/SSL tab. Add an SSH key or check Use SSL and supply the CA, client cert, and key. DataGrip appends the right flags to the JDBC URL.

What best practices should I follow?

Always set serverTimezone to avoid time drift, store secrets in DataGrip’s password vault, and share data-source settings via .idea files for team consistency.

.

Why How to Connect MariaDB to DataGrip is important

How to Connect MariaDB to DataGrip Example Usage


-- After connecting in DataGrip
SELECT o.id,
       c.name,
       o.total_amount,
       o.order_date
FROM   Orders o
JOIN   Customers c ON c.id = o.customer_id
WHERE  o.order_date >= CURRENT_DATE - INTERVAL 30 DAY
ORDER  BY o.order_date DESC;

How to Connect MariaDB to DataGrip Syntax


jdbc:mariadb://<host>:<port>/<database>?user=<user>&password=<password>&serverTimezone=UTC&allowMultiQueries=true&useSSL=false
-- Ecommerce example
jdbc:mariadb://db.shop.io:3306/shop?user=analyst&password=S3cret!&serverTimezone=UTC&useSSL=true

Common Mistakes

Frequently Asked Questions (FAQs)

Is the MySQL driver interchangeable with MariaDB?

It usually works, but the official MariaDB driver offers better compatibility and supports MariaDB-specific SQL modes.

Can I share the data source with teammates?

Yes. Check Share data source in the dialog. DataGrip stores the settings in .idea/dataSources/ so the whole team can reuse them.

How do I connect through a bastion host?

Open the SSH/SSL tab, enable Use SSH tunnel, and enter bastion credentials. DataGrip forwards traffic automatically.

Want to learn about other SQL terms?

Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie Logo
Bauhealth Logo
Truvideo Logo
Welcome to the Galaxy, Guardian!
Oops! Something went wrong while submitting the form.