Import CSV file directly into MySQL , CSV 를 mysql 테이블에 넣기

less than 1 minute read

LOAD DATA [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE ‘file_name’ [REPLACE | IGNORE] INTO TABLE tbl_name [CHARACTER SET charset_name] [{FIELDS | COLUMNS} [TERMINATED BY ‘string’] [[OPTIONALLY] ENCLOSED BY ‘char’] [ESCAPED BY ‘char’] ] [LINES [STARTING BY ‘string’] [TERMINATED BY ‘string’] ] [IGNORE number LINES] [(col_name_or_user_var,…)] [SET col_name = expr,…]


load data local infile ‘uniq.csv’ into table tblUniq  fields terminated by ’,’ enclosed by ’”‘ lines terminated by ‘\n’ (uniqName, uniqCity, uniqComments)


🔗original-link

Updated: