[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ERROR 1062: Duplicate entry '1' for key 1
Dear all,
I'm getting this error from a CGI script (Perl and DBI, but it's definitely
NOT DBI). My table is this:
Field Type
id INTEGER(11) AUTO_INCREMENT PRIMARY KEY
item_id INTEGER(11)
category_id INTEGER(11)
I'm using mySQL version 3.21.33b under Debian Linux.
The SQL that causes this error is:
INSERT INTO item_category (item_id, category_id) VALUES (nnnn, nnnn);
This fails with the above error both via CGI and if I enter the command
manually. It seems to me that mySQL has stopped auto-incrementing, but I
don't understand why? There are about 2500 records in the table, and there
is a record id=1, and the id numbers do not run continuously, that is, some
records have been deleted.
Help!!
Thanks
Hugh
--
---------------------------------------------------------------------
Please check "http://www.mysql.com/documentation/manual.php" before
posting. To request this thread, e-mail mysql-thread60370@xxxxxxxxxxxxxxx
To unsubscribe, send a message to:
<mysql-unsubscribe-treed=ultraviolet.org@xxxxxxxxxxxxxxx>
If you have a broken mail client that cannot send a message to
the above address (Microsoft Outlook), you can use:
http://lists.mysql.com/php/unsubscribe.php
This mailing list archive is a service of Copilot Consulting.