MySQL workbench table data import wizard extremely slow

后端 未结 6 1828
时光说笑
时光说笑 2020-12-28 14:21

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, p

6条回答
  •  星月不相逢
    2020-12-28 14:49

    This is an alternative. Dump your CSV data into sql script, you need to write down some code for this. Basically, your csv data will get converted into similar to below commands
    INSERT INTO TABLE_NAME values(1,2),(1,3),....;
    now use MySQL shell script and use SOURCE command
    mysql> source C:/Users/Desktop/sql scripts/script.sql
    your data will get imported faster as compared to direct importing a CSV for millions of record.

提交回复
热议问题