Posted: 22-02-2018

Super Fast Import large CSV data set in Mysql using Laravel

Super Fast Import large CSV data set in Mysql  using Laravel

My co-worker Luca found this tricky to import in no time a large CSV data set file in a MySql table using Laravel. 

LOAD DATA LOCAL INFILE '/path/to/file.csv'
INTO TABLE table_name FIELDS TERMINATED BY ';'
ENCLOSED BY '"' LINES TERMINATED BY '\r\n'
IGNORE 1 LINES (field_one, field_two, field_three);