以下命令在遵守CSV引用和转义规则的同时,将CSV文件导入具有相同列的MySQL表中。
load data infile '/tmp/file.csv' into table my_table fields terminated by ',' optionally enclosed by '"' escaped by '"' lines terminated by '\n' ignore 1 lines; -- skip the header row