List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:October 6 1999 4:48pm
Subject:Re: ERROR 1062: Duplicate entry '1' for key 1
View as plain text  
>>>>> "Thomas" == Thomas Lund <tld@stripped> writes:

Thomas> Hi

Thomas> Sorry - haven't followed this thread, but I have just filed a bug report
Thomas> on this problem. I guess you are using 3.23.4. If you show fields from
Thomas> tablename, then your auto_increment/primary key field has NULL as
Thomas> default - even though you state not null in create table.

Thomas> I got the same error in my application
Thomas> ERROR 1062: Duplicate entry '1' for key 1

Thomas> when I tried to insert into the table and expecting mysql to
Thomas> auto_increment it automatically.

Thomas> /Thomas

Hi!

It's actually ok that an auto_increment column has NULL as default.
(NULL means in this context the next auto_increment number).

There is no known problem with auto_increment columns and LOAD DATA..
Any change you can post a full example of this?

Regards,
Monty
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