MYSQL:在LOAD DATA INFILE之后显示跳过的记录? [英] MYSQL: Display Skipped records after LOAD DATA INFILE?

查看:961
本文介绍了MYSQL:在LOAD DATA INFILE之后显示跳过的记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在MySQL中,我使用了LOAD DATA LOCAL INFILE,它工作正常.最后,我收到一条消息,如:

In MySQL I've used LOAD DATA LOCAL INFILE which works fine. At the end I get a message like:

Records: 460377  Deleted: 0  Skipped: 145280  Warnings: 0

如何查看被跳过的记录的行号? SHOW warnings不起作用:

How can I view the line number of the records that were skipped? SHOW warnings doesn't work:

mysql> show warnings;
Empty set (0.00 sec)

推荐答案

如果没有警告,但是跳过了某些行,则可能意味着对跳过的行重复了主键.

If there was no warnings, but some rows were skipped, then it may mean that the primary key was duplicated for the skipped rows.

找出重复项的最简单方法是在excel中打开本地文件,然后在主键列上执行重复项删除,以查看是否存在重复项.

The easiest way to find out duplicates is by openning the local file in excel and performing a duplicate removal on the primary key column to see if there are any.

这篇关于MYSQL:在LOAD DATA INFILE之后显示跳过的记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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