1.1.1 phenomena
Perform the database operation, and the following error message appears:
ERROR 1062 (23000): Duplicate entry ' 0 ' for key ' PRIMARY '
1.1.2 cause
The problem table before the primary key is not set to automatically grow the column, and then the program needs to modify it to automatically grow the column, the result is inserted in the first data, the primary key is 0 , and then increase the data, it appears as the error, see the information is every time the data is added, the primary key is 0 , so this error is caused.
It is estimated that the primary key was not an autogrow column when it was created before the table, but was later modified to an autogrow column, but MYSQL there was a problem with engine recognition.
1.1.3 Solve
put this table Drop and then recreate it with the correct statement (including the primary key for the autogrow column).
Mysql-error 1062 (23000)