不将数据从csv文件恢复到mysql

时间:2017-04-04 17:32:02

标签: mysql

我想将csv文件导入mysql。我使用以下代码:

LOAD DATA local INFILE 'D:\20507.csv' 
INTO TABLE rohit1
FIELDS TERMINATED BY ',' 
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 ROWS

但它不起作用;它只显示第一列记录? 帮我出去。

1 个答案:

答案 0 :(得分:1)

试试这个:

LOAD DATA local INFILE 'D:/20507.csv' INTO TABLE rohit1 FIELDS TERMINATED
BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\r\n' IGNORE 1 LINES;