I delete all records from the table and cannot insert second element to the table. Auto increment starts with higher number ..

ERROR 1062: Duplicate entry '2147483647' for key 1

From: "Larry Brown" <[EMAIL PROTECTED]>
To: "Mike Mapsnac" <[EMAIL PROTECTED]>,"MySQL List" <[EMAIL PROTECTED]>
Subject: RE: insert: auto increment field
Date: Sun, 4 Jan 2004 19:09:59 -0500


Is this a test db?  If so go ahead and drop your records so there are none
in there and start entering them and checking their id as you do.  After
dropping all records it should start back at 1 and increment forward.  I
don't know how the index went up to max for that field.  Perhaps something
during previous tests.  If you can't drop the current records document that
in your reply and maybe someone else can give another suggestion.

-----Original Message-----
From: Mike Mapsnac [mailto:[EMAIL PROTECTED]
Sent: Sunday, January 04, 2004 6:53 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: insert: auto increment field


I use both metods and they works But when I make another insert I receive a
message
ERROR: 1062 Duplicate entry '2147483647' for key 1.


Why id (primaty , and auto_increment) start from 2147483647 and not from 0
or 1

Thanks


>From: Donald Henson <[EMAIL PROTECTED]>
>To: MySQL List <[EMAIL PROTECTED]>
>Subject: Re: insert: auto increment field
>Date: Sun, 04 Jan 2004 08:44:56 -0700
>
>On Sun, 2004-01-04 at 08:09, Mike Mapsnac wrote:
> > I have table with 7 fields. First field is id (auto increment). As I
> > understand the value should start from 0 and next value will auto
> > increment.
> >
> > And I shouldn't add insert the value. So the insert
> > statemens below gives me an error. ERROR 1136:Column count doesn't match
> > value count at row 1
> >
> > insert into product values('456789','t1', 'new', 2, 2, 10);
>
>Try using NULL for the id field, thusly:
>
>insert into product values (NULL,'456789','t1','new',2,2,10);
>
>I didn't actually try this but it should work.
>
>Don Henson
>
>
>
>--
>MySQL General Mailing List
>For list archives: http://lists.mysql.com/mysql
>To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
>


_________________________________________________________________
Get reliable dial-up Internet access now with our limited-time introductory
offer.  http://join.msn.com/?page=dept/dialup


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]





_________________________________________________________________
Check your PC for viruses with the FREE McAfee online computer scan. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963



-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to