Back to SQL Errors
SQL Error

1062

Duplicate entry

What does this error mean?

MySQL error occurs when trying to insert a duplicate value in a column with UNIQUE constraint.

How to fix 1062?

Check for existing records before inserting. Use INSERT IGNORE or ON DUPLICATE KEY UPDATE. Remove the duplicate value or modify the unique constraint.

Related SQL Errors