MYSQL: Display Skipped records after LOAD DATA INFILE?

后端 未结 5 2154
被撕碎了的回忆
被撕碎了的回忆 2021-02-19 15:34

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         


        
5条回答
  •  天命终不由人
    2021-02-19 16:32

    I use bash command-line to find the duplicate row in the csv file:

    awk -F\, '{print $1$2}' /my/source/file.csv| sort -n| uniq -c| grep -v "^\ *1"
    

    when the two first columns are the primary key.

提交回复
热议问题