Cannot connect DataGrip to database hosted using XAMPP

3.3k Views Asked by At

I am currently trying to learn MySQL.

I have used XAMPP to setup my database on PhpMyAdmin.

suppose,

  host: localhost <br>
   port: 3306 <br>
   database name: db1<br>
   username: user1<br>
   password: pass1<br>
   URL: jdbc:mysql://localhost:3306/db1

When I put in the above information into DataGrip (File -> Data Sources -> Add MySQL) and Test the connection, it fails. Am I missing something notation wise?

2

There are 2 best solutions below

2
On

Assuming XAMPP installed, this is easy to do.

1) Open your browser and enter http://localhost/phpmyadmin. This will bring you to the MySQL setup page:

2) Enter a name for the database, then click on the Create button

3) Ensure the database was successfully created:

This database can now be used by any application that requires a MySQL

Also make sure you are able to connect to Mysql database from your local machine.Test the connectivity by pining the port or manually open any database connection using mysql client

0
On

If you're using XAMPP check the Port used for MySQL and enter it in the port section of data source inside Datagrip (In my case by Default port 3306 was used for MySQL). Enter your DB username and pass and hit test connection!