Database version: 5.6.16
Problem:
Development calls to say the warehouse can not order, the program inserted data tip: Inbound single xxxx1589762285 Confirmation failure: Duplicate entry ' 8388607 ' for key ' PRIMARY '
To view the database table structure:
Show CREATE TABLE table_name;
Table structure of the field as the primary key self-increment, should be no problem ah, carefully see the table structure ID type as follows:
' ID ' mediumint (8) Not NULL auto_increment
The field type is Mediumint, and the maximum supported value is 8388607, which determines the problem.
Modify the table structure of the ID field type, when modified must pay attention to add auto_increment, otherwise modified, the primary key self-increment to fail
ALTER TABLE table_name Modify ID bigint not NULL aotu_increment;
After the successful modification, contact development, let the warehouse to try again, no problem!
MySQL primary key conflict, unable to insert data