Mysql 在带有加载数据填充的字段中导入带有逗号的CSV

Mysql 在带有加载数据填充的字段中导入带有逗号的CSV,mysql,csv,load-data-infile,Mysql,Csv,Load Data Infile,我有一个CSV文件,格式如下 nconst,primaryName,birthYear,deathYear,primaryProfession,knownForTitles nm0000001,Fred,1899,1987,"soundtrack,actor,miscellaneous","tt0072308,tt0045537" nm0000002,Lauren,1924,2014,"actress,soundtrack","tt0038355,tt0117057,tt0037382" 有些

我有一个CSV文件,格式如下

nconst,primaryName,birthYear,deathYear,primaryProfession,knownForTitles
nm0000001,Fred,1899,1987,"soundtrack,actor,miscellaneous","tt0072308,tt0045537"
nm0000002,Lauren,1924,2014,"actress,soundtrack","tt0038355,tt0117057,tt0037382"
有些字段用引号括起来,这不是问题,也有一个逗号作为分隔符

我正在mysql命令行中使用以下命令:

load data local infile '/home/ec2-user/sample.csv' into table movies.`sample` fields terminated by ',' enclosed by '"' lines terminated by '\n' ignore 1 lines; 
哪位实习生没有给出错误,但数据以错误格式插入下表:

**nm0000001**   Fred  1899  1987    soundtrack,actor,miscellaneous  tt0043044,tt0072308,tt0050419,tt0045537" **nm0000002**,Lauren Bacall,1924,2014,"actress,soundtrack
正如我们可以清楚地看到的,来自第二行的数据附加在第一行中

提前谢谢

编辑

表定义:

 CREATE TABLE `sample` (
   `nconst` text,
   `primaryName` text,
   `birthYear` int(11) DEFAULT NULL,
   `deathYear` text,
   `primaryProfession` text,
   `knownForTitles` text
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1;

请添加表定义。当csv文件中只有fred出现时,您是如何上传fred astaire的?只有fred astaire,我为了格式化而更改了它尝试\r\n而不是\n@amol,因为换行过去是CR/LF(旧打字机材料,回车,换行..将打印头移回起始位置(回车)然后移动到下一行(换行)。CR为\r,lf为\n(新行)。行终止符是其中之一,或两者的组合,因此如果1不起作用,通常是另一个。