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)