List:General Discussion« Previous MessageNext Message »
From:Jan Dvorak Date:October 4 1999 9:45am
Subject:Re: ERROR 1062: Duplicate entry '1' for key 1
View as plain text  
d e l d h a n o a wrote:

> Here is my dilemma:
>
> mysql> describe console;
> +-------------+--------------+------+-----+---------+----------------+
> | Field       | Type         | Null | Key | Default | Extra          |
> +-------------+--------------+------+-----+---------+----------------+
> | ID          | int(11)      |      | PRI | 0       | auto_increment |
> | title       | varchar(64)  | YES  |     | NULL    |                |
> | url         | varchar(96)  | YES  |     | NULL    |                |
> | description | varchar(220) | YES  |     | NULL    |                |
> | category    | int(11)      | YES  |     | NULL    |                |
> | keywords    | varchar(64)  | YES  |     | NULL    |                |
> +-------------+--------------+------+-----+---------+----------------+
> 6 rows in set (0.02 sec)
>
> mysql> load data infile "/usr/local/webs/gsbeta/cons.txt" into table
> console;
> ERROR 1062: Duplicate entry '1' for key 1
>
> Now how do I get rid of this duplicate key?  I just want to load the table
> into mysql!

Are you sure you have also the ID field in your data file?
If not so, you may have to use the FIELDS clause of LOAD DATA INFILE.

--Jan Dvorak, MathAn Praha, CZ.

> - Del

Thread
ERROR 1062: Duplicate entry '1' for key 1d e l   d h a n o a4 Oct
  • Re: ERROR 1062: Duplicate entry '1' for key 1Martin Ramsch4 Oct
  • Re: ERROR 1062: Duplicate entry '1' for key 1Jan Dvorak4 Oct
  • Re: ERROR 1062: Duplicate entry '1' for key 1Jan Dvorak4 Oct
  • Re: ERROR 1062: Duplicate entry '1' for key 1Tonu Samuel4 Oct
  • Re: ERROR 1062: Duplicate entry '1' for key 1Thomas Lund4 Oct
    • Re: ERROR 1062: Duplicate entry '1' for key 1Michael Widenius6 Oct
  • Re: ERROR 1062: Duplicate entry '1' for key 1Thomas Lund7 Oct
    • Re: ERROR 1062: Duplicate entry '1' for key 1Michael Widenius7 Oct
  • Re: ERROR 1062: Duplicate entry '1' for key 1Thomas Lund7 Oct