LOAD DATA LOCAL INFILE在69k行处停止导入 [英] LOAD DATA LOCAL INFILE stops imports at 69k rows

查看:164
本文介绍了LOAD DATA LOCAL INFILE在69k行处停止导入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用LOAD DATA LOCAL INFILE,它似乎在〜69k行处停止.

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

.csv文件包含大约138k条目,所有条目均已正确转义并包含在内.

The .csv file contains around 138k entries, all escaped and enclosed properly.

Mysql版本:Ver 14.14 Distrib 5.1.50, for Win32 (ia32)

命令:

load data local infile 'path/to/file.csv' into table contacts
fields terminated by ','
enclosed by '"'
lines terminated by '\n'
(column1, column2, column3,...)

推荐答案

请参阅我的最新评论,确保选择的行尾与用于制作.csv文件的操作系统相对应.

See my last comment, Make sure the line endings you select corresponds with your OS that you used to make the .csv file.

呃,看来这是行尾问题.我改用\ r \ n作为行尾,并且行得通.我也将MYSQL MODE更改为MYSQL40-显然删除了找不到默认值时跳过导入行". @SylvainLeroux Tx的显示警告,它帮助:D

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

我正在寻找基于Unix的行尾,导致mysql导入将其读为一行.

I was looking for Unix based line endings that resulted in the mysql import reading it as one line.

这篇关于LOAD DATA LOCAL INFILE在69k行处停止导入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆