MySQL: Blank row in table after LOAD DATA INFILE

Posted by Tom on Stack Overflow See other posts from Stack Overflow or by Tom
Published on 2010-05-12T14:36:05Z Indexed on 2010/05/12 16:14 UTC
Read the original article Hit count: 326

Filed under:
|
|
|

Hi,

I'm uploading a large amount of data from a CSV (I'm doing it via MySQL Workbench):

LOAD DATA INFILE 'C:/development/mydoc.csv' INTO TABLE mydatabase.mytable CHARACTER SET utf8
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\r';

However, I'm noticing that it keeps adding an empty line full of nulls/zeros after the last record. I'm guessing it's because of the "LINES TERMINATED" command. However, I need that to load the data in correctly.

Is there some way around this / some better SQL to avoid the blank row in the table?

Thanks

© Stack Overflow or respective owner

Related posts about mysql

Related posts about data