我有一个包含以下字段的表:
Name (varchar)
Ranking (int)
Age (int)
Favourite Court (varchar)
和这样的 CSV 文件
name;age;current_ranking;favourite_court
sample1;22;5;Hard
sample2;21;6;Clay
我尝试使用 MySQL 导入它:LOAD DATA LOCAL INFILE 'c:/players.csv' INTO TABLE players FIELDS TERMINATED BY ';' LINES TERMINATED BY '\n';
or LOAD DATA LOCAL INFILE 'c:/players.csv' INTO TABLE players FIELDS TERMINATED BY ';' LINES TERMINATED BY '\n' (name,age,current_ranking,favourite_court);
,带或不带文件头(即名称;年龄...)。它不起作用,字段被弄乱了。为什么?