Hi
Sorry - haven't followed this thread, but I have just filed a bug report
on this problem. I guess you are using 3.23.4. If you show fields from
tablename, then your auto_increment/primary key field has NULL as
default - even though you state not null in create table.
I got the same error in my application
ERROR 1062: Duplicate entry '1' for key 1
when I tried to insert into the table and expecting mysql to
auto_increment it automatically.
/Thomas
Tonu Samuel wrote:
>
> > > 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.
>
> ...or use IGNORE keyword.
>
> --
> +----------------------------------------------------------------+
> | TcX ____ __ _____ _____ ___ |
> | /*/\*\/\*\ /*/ \*\ /*/ \*\ |*| Tõnu Samuel |
> | /*/ /*/ /*/ \*\_ |*| |*||*| tonu@stripped |
> | /*/ /*/ /*/\*\/*/ \*\|*| |*||*| Tallinn, Estonia |
> | /*/ /*/ /*/\*\_/*/ \*\_/*/ |*|____ |
> | ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^ |
> | /*/ \*\ Developers Team |
> +----------------------------------------------------------------+
>
> ---------------------------------------------------------------------
> Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
> posting. To request this thread, e-mail mysql-thread15056@stripped
>
> To unsubscribe, send a message to the address shown in the
> List-Unsubscribe header of this message. If you cannot see it,
> e-mail mysql-unsubscribe@stripped instead.
--
Carl Bro as, Internet Design, Granskoven 8, 2600 Glostrup
Direct phone : 43 48 62 56 Gen. phone : 43 48 60 60
Dept. fax : 43 48 68 10 Gen. fax : 43 48 66 60