MYSQL: Display Skipped records after LOAD DATA INFILE?

Nate Murray picture Nate Murray · Apr 30, 2010 · Viewed 30.2k times · Source

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

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)

Answer

oabarca picture oabarca · Feb 22, 2014

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

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.