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

I am not sure why I get this error # 1062 - Duplicate entry '1' for key 1 cany, someone explains what this means. Thanks

+6
mysql mysql-error-1062 phpmyadmin
source share
5 answers

Most likely, your column will be unique, and you will try to enter a row with an identifier that already exists in your table.

+6
source share

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

+4
source share

I think you are trying to insert "1" into a unique key field that already has a value of "1"

+2
source share

The problem is with your file - you are trying to create a database using a copy - at the top of your file you will find something like this:

CREATE DATABASE IF *THE_NAME_OF_YOUR_DB* DOES NOT EXIST *THE_NAME_OF_YOUR_DB* DEFAULT SETTING PARAMETER latin1 COLLATE latin1_general_ci; USE *THE_NAME_OF_YOUR_DB* ;

and I’m sure that you already have a database with this name - IN ONE SERD - please check.

+1
source share

You need to add a primary key with a group in which one primary key must be unique. for example, if the table has 4 columns id, name, address, group_id, where group_id has a duplicate value, if I want to add group_id as primary, then this should be in the group consisting of id and group_id

0
source share

All Articles