Originally Posted by
Glenn the Great
Seconded, Beldaran's method is how I do it at work.
Be mindful that Windows is different from everyone else in that it terminates lines with two characters. If this is your case, you'll want to use LINES TERMINATED BY '\r\n' or else you'll inadvertently load the \r character into your database.
My last tip is that if you need to do some kind of on-the-fly transformation to the data as it is loaded into MySQL, you can use the @ symbol like this:
LOAD DATA LOCAL INFILE 'myFile.csv' INTO TABLE MyTable
FIELDS TERMINATED BY ',' ENCLOSED BY '"'
LINES TERMINATED BY '\r\n'
(colName1, colName2, @colName3)
SET colName3 = TRIM(@colName3)