LOAD DATA LOCAL INFILE stops imports at 69k rows

倾然丶 夕夏残阳落幕 提交于 2019-12-11 11:27:15

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!