Skip to content

Instantly share code, notes, and snippets.

@ijmorgado
Created January 27, 2013 07:29
Show Gist options
  • Save ijmorgado/4647231 to your computer and use it in GitHub Desktop.
Save ijmorgado/4647231 to your computer and use it in GitHub Desktop.
That's a small sql script to import a csv file without headers...just a bunch of data...I don't know why I had a trouble with the server when I tried other samples....
LOAD DATA local INFILE '/path/to/file.csv'
INTO TABLE name_scheme.name_of_table
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
ESCAPED BY '\\'
LINES TERMINATED BY '\n'
IGNORE 0 LINES
(field1,field2,field3,field4);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment