Last active
May 12, 2019 16:11
-
-
Save zlargon/f6442db1d82cdb2f3540c994d3fa5a98 to your computer and use it in GitHub Desktop.
import large CSV data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET GLOBAL local_infile = true; | |
SHOW GLOBAL VARIABLES LIKE 'local_infile'; | |
LOAD DATA LOCAL INFILE '<file.csv>' | |
INTO TABLE '<table_name>' | |
COLUMNS TERMINATED BY ',' | |
OPTIONALLY ENCLOSED BY '"' | |
ESCAPED BY '"' | |
LINES TERMINATED BY '\r\n' | |
IGNORE 1 LINES; -- ignore the field names |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment