Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL workbench table data import wizard extremely slow

I need to import a csv file with 20 million rows and 2 columns into a database, but when I try to do this with MySQL Workbench's data import wizard it is extremely slow, probably is going to take 1 month to finish, looking at the progress bar.

There has to be some faster way to do this, I hope.

like image 803
BlueStarry Avatar asked Oct 23 '15 07:10

BlueStarry


People also ask

How long does MySQL take to import csv?

It imports CSV/text files much quicker than MySQL Workbench. Show activity on this post. It would take me 40min via MySQL admin, connecting to a remote MySQL sever. On the MySQL server itself the upload takes a few minutes.

How do I enable load data local infile in MySQL workbench?

To disable or enable it explicitly, use the --local-infile=0 or --local-infile[=1] option. For the mysqlimport client, local data loading is not used by default. To disable or enable it explicitly, use the --local=0 or --local[=1] option.


1 Answers

Always use Load Data Infile as a first attempt for huge sets of data.

Mysql Manual page on Load Data Infile.

Wrote up several answers for this question, but for a peer comparison, see this guy's question and my Answer and his time comparisons of Workbench vs Load Data Infile.

like image 114
Drew Avatar answered Sep 17 '22 16:09

Drew