Skip to content

Instantly share code, notes, and snippets.

@bakertim
Created April 15, 2014 17:26
Show Gist options
  • Save bakertim/10750015 to your computer and use it in GitHub Desktop.
Save bakertim/10750015 to your computer and use it in GitHub Desktop.
SQL: import local csv file
mysql -u root -p --local-infile __DATABASE_NAME__
-- SQL
LOAD DATA LOCAL INFILE '__relative_path_to_file' INTO TABLE __TABLE_NAME__ FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (field1, field2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment