Fix DataGrip Data Source – Connection Failed or Missing Driver
In this tutorial, you'll learn about Fix DataGrip Data Source. We cover key concepts, practical examples, and best practices.
You create a new data source in DataGrip, click Test Connection, and get a red error: "Connection to [host] refused" or "Driver class not found". The credentials are correct, the server is up — but DataGrip won't connect.
Wrong ❌
Host: localhost
Port: 3306
User: root
Database: mydb
URL: jdbc:mysql://localhost:3306/mydb
You click Test Connection and see:
Cannot connect. Driver 'MySQL' is missing.
DataGrip didn't download the JDBC driver automatically. Or:
Connection refused: connect
The server is running but DataGrip can't reach it.
Right ✅
Download the driver:
- Open Database Explorer (
Alt+1) - Click
+→ Data Source → MySQL - In the General tab, find the Driver section
- Click the Driver link (e.g.
MySQL (missing)) - Click Download in the driver settings dialog
- Wait for the green checkmark → OK
Configure the connection:
Host: localhost
Port: 3306
User: root
Password: [store with PasswordSafe]
Database: mydb
URL: jdbc:mysql://localhost:3306/mydb?useSSL=false&allowPublicKeyRetrieval=true
Test again:
✅ Connected (0 ms)
MySQL 8.0.33
Driver: MySQL Connector/J 8.0.33
(Optional) SSH tunnel: Switch to the SSH/SSL tab, enable Use SSH tunnel, and configure the jump host.
Root Cause
DataGrip does not ship JDBC drivers — it downloads them on first use. Network restrictions (proxy, firewall) can block the download, leaving the driver in a "missing" state. Alternatively, the JDBC URL is malformed or the server doesn't listen on the expected interface.
Prevention
- Allow
download.jetbrains.comandrepo1.maven.orgthrough your corporate proxy. - Use the PasswordSafe option (not "Forced by connection URL") so credentials persist across restarts.
- Before creating a data source, verify connectivity with
telnet <host> <port>or a CLI client. - Save frequently used data sources as Database Driver templates via Tools → Driver Manager.
Common Mistakes with data source
- Using
returnto exit a function early instead of wrapping a pure value in the monad - Mixing let bindings with <- bindings in do notation, producing type errors
- Overlapping type class instances that cause GHC to reject the program with ambiguous dispatch errors
These mistakes appear frequently in real-world DATAGRIP code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.
Practice Exercise
Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.
This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.
FAQ
Comprehensive DataGrip setup is covered in the DodaTech DataGrip Fundamentals course.
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro