Error Message:
Error Code: 1062. Duplicate entry ‘%s’ for
key %d
Example:
Error Code: 1062. Duplicate entry
‘1’ for key ‘PRIMARY’
Possible Reason:
Case 1: Duplicate
value.
The data you are trying to insert is already present in the
column primary key. The primary key column is unique and it will
not accept the duplicate entry.
Case 2: Unique data field.
You are trying to add a column to an existing table which
contains data and set it as unique.
Case 3: Data type –upper limit.
The auto_increment field reached its maximum range.
| … |