将 CSV 文件导入 MySQL 表
以下命令将 CSV 文件导入具有相同列的 MySQL 表,同时遵循 CSV 引用和转义规则。
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