Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

phpMyAdmin error #1062 - Duplicate entry '1' for key 1

I am not sure why I am getting this error #1062 - Duplicate entry '1' for key 1 cany any one help explain what it means. Thanks

like image 559
Webne Avatar asked Jul 22 '10 17:07

Webne


2 Answers

More than likely your column is set to be Unique, and you're trying to input a row with an ID that already exists in your table.

like image 51
bradenkeith Avatar answered Oct 14 '22 00:10

bradenkeith


You are probably trying to insert a record with the ID (or some other field) 1 set, while such a record already exists in the table. The field that is the primary key must have a unique value for each record.

like image 26
Pekka Avatar answered Oct 14 '22 02:10

Pekka