Posted By

kirkfortune on 08/26/12


Tagged

mysqlcsv


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

kirkfortune


Insert into mysql from csv file


 / Published in: MySQL
 

ensure the url to the csv file is in the root of your file system (eg: C:/mycsvfile.csv)

  1. LOAD DATA LOCAL INFILE '/file.csv' INTO TABLE `table_name` FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'
  2. (field1,field2,etc)

Report this snippet  

You need to login to post a comment.