We Recommend

SQL Cookbook SQL Cookbook
Written in O'Reilly's popular Problem/Solution/Discussion style, the SQL Cookbook is sure to please. Anthony's credo is: "When it comes down to it, we all go to work, we all have bills to pay, and we all want to go home at a reasonable time and enjoy what's still available of our days." The SQL Cookbook moves quickly from problem to solution, saving you time each step of the way.


Posted By

jarnaldich on 06/26/08


Tagged

mysql csv excel


Versions (?)


Who likes this?

1 person has marked this snippet as a favorite

heinz1959


Importing data from (Excel) CSV into MySQL


Published in: SQL 


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

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

  1. LOAD DATA INFILE 'datafile.csv' INTO TABLE tbl_name
  2. FIELDS TERMINATED BY ',' ENCLOSED BY '"' ESCAPED BY '\\'
  3. LINES TERMINATED BY '\r\n'
  4. IGNORE 1 LINES;

Report this snippet 

You need to login to post a comment.