问题
I am using the LOAD DATA LOCAL INFILE and it seems to be stopping at ~69k rows.
Is is a memory limit that's too low? of buffer size?
Query OK, 68844 rows affected, 65535 warnings (4.20 sec)
Records: 69182 Deleted: 0 Skipped: 338 Warnings: 160539
The .csv file contains around 138k entries, all escaped and enclosed properly.
Edit: Mysql version: Ver 14.14 Distrib 5.1.50, for Win32 (ia32)
Edit 2: The command:
load data local infile 'path/to/file.csv' into table contacts
fields terminated by ','
enclosed by '"'
lines terminated by '\n'
(column1, column2, column3,...)
回答1:
See my last comment, Make sure the line endings you select corresponds with your OS that you used to make the .csv file.
Ugh, Looks like it was a line endings issue. I changed to using \r\n for line endings and it worked. I also changed my MYSQL MODE to be MYSQL40 - apparently that removes the 'skip import row on default value not found'. @SylvainLeroux Tx for the show warnings, it helped :D
I was looking for Unix based line endings that resulted in the mysql import reading it as one line.
来源:https://stackoverflow.com/questions/17995827/load-data-local-infile-stops-imports-at-69k-rows