將 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