Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to import CSV data to MySQL in JetBrains DataGrip

I'm studying MySQL. I need to import data from a CSV file to a MySQL table using JetBrains DataGrip.

I've done such this job before in dbForge MySQL, but last week I moved from Windows to Linux.

There are some questions how to import CSV to MySQL on StackOverflow, but I'm still not so familiar with SQL.

How do I import a CSV data file in JetBrains DataGrip?

Thank you!

like image 706
Ilya Rusin Avatar asked Jan 20 '16 14:01

Ilya Rusin


People also ask

How do I import a CSV file into DataGrip?

Import CSV There is a dedicated UI for importing DSV (CSV and TSV) files to the database. Click the schema you wish to import data to, and choose Import From File… from the context menu. Then select the CSV file where your data is stored. You will see the Import dialog window.

How do I import SQL DataGrip?

In DataGrip go to File > Open and select your mysql dump file. Then right click the tab for the file to get the context menu, and select "Run [your filename...]" option. It may ask you to select your schema to apply the run to.


2 Answers

  1. Context menu of datasource you want to import to
  2. Choose Import from File....
  3. Customize the table that will be created, check the preview and press OK.

Context menu Import Dialog

like image 52
moscas Avatar answered Sep 29 '22 18:09

moscas


Precision : The pinned answer explains how to create and populate a new table.

To populate an already existing table it's quite similar: use the context menu of this particular table to choose Import From File. Then the steps are similar to the ones in the pinned answer.

Right click the table to update then import data from file

like image 8
amiabl Avatar answered Sep 29 '22 18:09

amiabl