nix, shell, perl, php, mysql and mac os x tips and tricks

Tuesday, June 2, 2009

Import a csv file (with header line) into mysql with LOAD DATA

LOAD DATA LOCAL INFILE '/home/me/yo.csv' INTO TABLE 1by1_email 
FIELDS TERMINATED BY ',' ENCLOSED BY '"' 
LINES TERMINATED BY "\n"  IGNORE 1 LINES (fields,fields...);

No comments:

Post a Comment