1.1 phenomenon
when executing database operation, the following error message appears:
ERROR 1062 (23000): Duplicate entry ‘0’ for key ‘PRIMARY’
1.1.2 reasons
before the problem table, the primary key was not set as an automatic growth column. Later, the program needs to modify it as an automatic growth column. As a result, the first data is inserted. The primary key is 0 , and if the data is added later, the above error will appear. The information is that every time the data is added in the future, the primary key is 0 , So it leads to this error
it is estimated that when the table was created, the primary key was not an automatic growth column, but it was later modified to an automatic growth column. However, there was a problem with the MySQL engine recognition
1.1.3 solve
drop the table drop , and then create it again with correct statements (including the primary key is the auto growth column)
Similar Posts:
- mysql: [Err] 1075 – Incorrect table definition; there can be only one auto column and it must be d…
- The database returned no natively generated identity value [How to Solve]
- MySQL ERROR 1005: Can’t create table (errno: 150) [How to Solve]
- MySQL exclude error 1114 holmium HY000 41 holmium“
- used in key specification without a key length
- MySQL timestamp set default value error Invalid default value reason and solution
- [Err] 1214 – The used table type doesn’t support FULLTEXT indexes
- [Solved] MySQL uses the workbench tool, and the table status is read only
- [Solved] PhpMyAdmin #1089 – Incorrect prefix key; the storage engine doesn’t support unique pre…
- Incorrect column specifier for column “id”