Duplicate entry '97112' for key 1,duplicateentry

來源:互聯網
上載者:User

Duplicate entry '97112' for key 1,duplicateentry

1、錯誤描述

2014-07-08 10:27:13,939 ERROR(com.you.conn.JDBCConnection:104) -com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException:Duplicate entry '97112' for key 1


2、錯誤原因

    插入資料時,出現主鍵重複


3、解決辦法

    去掉主鍵重複的資料


Duplicate entry '1' for key 1資料庫表裡有 id=1 資料.
解決: 把資料表清空下.再插入
Duplicate entry '****' for key 1Duplicate entry 'blue' for key 1

哪主鍵?提示重複寫入

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.