Importing data from (Excel) CSV into MySQL


/ Published in: SQL
Save to your folder(s)

Imports data from CSV (excel-compatible format) into MySQL. Also check the mysqlimport utility and the complementary SELECT ... INTO OUTFILE.


Copy this code and paste it in your HTML
  1. LOAD DATA INFILE 'datafile.csv' INTO TABLE tbl_name
  2. FIELDS TERMINATED BY ',' ENCLOSED BY '"' ESCAPED BY '\\'
  3. LINES TERMINATED BY '
  4. '
  5. IGNORE 1 LINES;

URL: http://dev.mysql.com/doc/refman/5.0/en/load-data.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.