Re: auto_increment problem

2008-10-30 Thread Moon's Father
alter table tablename modify id int not null auto_increment primary key; On Sat, Oct 25, 2008 at 2:48 AM, Paul <[EMAIL PROTECTED]> wrote: > Anybody know if there's a way to change a primary key field that is not > auto-incremented, turning on auto-increment but preserving the values that > are cu

Re: AUTO_INCREMENT problem... ER_DUP_ENTRY? (No, it's not a one byte index :)

2004-06-23 Thread Kevin Brock
On Jun 23, 2004, at 8:15 AM, Michael Stassen wrote: So, if I understand you correctly, somewhere in the middle of a 20,000 row insert, a row gets inserted with auto_increment id = 87,123,456, say, then the next row tries to insert with the value 87,123,457 but fails. You fix this by skipping th

Re: AUTO_INCREMENT problem... ER_DUP_ENTRY? (No, it's not a one byte index :)

2004-06-23 Thread Michael Stassen
So, if I understand you correctly, somewhere in the middle of a 20,000 row insert, a row gets inserted with auto_increment id = 87,123,456, say, then the next row tries to insert with the value 87,123,457 but fails. You fix this by skipping the next value with ALTER TABLE yourtable AUTO_INCR

Re: AUTO_INCREMENT problem... ER_DUP_ENTRY? (No, it's not a one byte index :)

2004-06-22 Thread Kevin Brock
On Jun 18, 2004, at 5:31 PM, Scott Haneda wrote: While I do not know why, I would suggest you simply drop the PK and recreate it, this should be a whole lot faster than the alter. This took the same amount of time as the alter table (a little longer actually). The documentation says that in late

Re: AUTO_INCREMENT problem... ER_DUP_ENTRY? (No, it's not a one byte index :)

2004-06-20 Thread Michael Stassen
Robert A. Rosenberg wrote: At 13:37 -0400 on 06/19/2004, Michael Stassen wrote about Re: AUTO_INCREMENT problem... ER_DUP_ENTRY? (No, it's not a: Finally, just to cover all the bases, that really is 87 million inserts, not 8.7 million, right? I only ask because a MEDIUMINT column runs

Re: AUTO_INCREMENT problem... ER_DUP_ENTRY? (No, it's not a one byte index :)

2004-06-20 Thread Robert A. Rosenberg
At 13:37 -0400 on 06/19/2004, Michael Stassen wrote about Re: AUTO_INCREMENT problem... ER_DUP_ENTRY? (No, it's not a: Finally, just to cover all the bases, that really is 87 million inserts, not 8.7 million, right? I only ask because a MEDIUMINT column runs out a little past 8.3 millio

Re: AUTO_INCREMENT problem... ER_DUP_ENTRY? (No, it's not a one byte index :)

2004-06-19 Thread Robert A. Rosenberg
At 17:16 -0700 on 06/18/2004, Kevin Brock wrote about AUTO_INCREMENT problem... ER_DUP_ENTRY? (No, it's not a one: We have a table with a primary index which is INT NOT NULL AUTO_INCREMENT. After inserting ~87,000,000 entries, we started seeing error 1062, ER_DUP_ENTRY. You are wasting half your

Re: AUTO_INCREMENT problem... ER_DUP_ENTRY? (No, it's not a one byte index :)

2004-06-19 Thread Kevin Brock
On Jun 19, 2004, at 10:37 AM, Michael Stassen wrote: Something about your description doesn't quite fit, however. You say that you are "nowhere near the limit", but you say that resetting the "auto_increment starting point" fixes the problem. Those seem contradictory to me. To me as well, tha

Re: AUTO_INCREMENT problem... ER_DUP_ENTRY? (No, it's not a one byte index :)

2004-06-19 Thread Michael Stassen
To the best of my knowledge, AUTO_INCREMENT columns are limited only by the size of the int, so an INT NOT NULL AUTO_INCREMENT should go to 2,147,483,647. Something about your description doesn't quite fit, however. You say that you are "nowhere near the limit", but you say that resetting the

Re: AUTO_INCREMENT problem... ER_DUP_ENTRY? (No, it's not a one byte index :)

2004-06-19 Thread Kevin Brock
On Jun 19, 2004, at 6:03 AM, Terry Riley wrote: Just a suggestion, Kevin, but how about changing from INT to BIGINT? I thought of trying that, but since we're nowhere near the limit even for an INT I think changing to BIGINT is premature. I want to find out a bit more about what's happening firs

Re: AUTO_INCREMENT problem... ER_DUP_ENTRY? (No, it's not a one byte index :)

2004-06-19 Thread Kevin Brock
On Jun 18, 2004, at 5:31 PM, Scott Haneda wrote: on 06/18/2004 05:16 PM, Kevin Brock at [EMAIL PROTECTED] wrote: We have a table with a primary index which is INT NOT NULL AUTO_INCREMENT. After inserting ~87,000,000 entries, we started seeing error 1062, ER_DUP_ENTRY. While I do not know why, I wou

Re: AUTO_INCREMENT problem... ER_DUP_ENTRY? (No, it's not a one byte index :)

2004-06-19 Thread Terry Riley
Just a suggestion, Kevin, but how about changing from INT to BIGINT? Terry --Original Message- > We have a table with a primary index which is INT NOT NULL > AUTO_INCREMENT. > > After inserting ~87,000,000 entries, we started seeing error 1062, > ER_DUP_ENTRY. > > We can ge

Re: AUTO_INCREMENT problem... ER_DUP_ENTRY? (No, it's not a one byte index :)

2004-06-18 Thread Scott Haneda
on 06/18/2004 05:16 PM, Kevin Brock at [EMAIL PROTECTED] wrote: > We have a table with a primary index which is INT NOT NULL > AUTO_INCREMENT. > > After inserting ~87,000,000 entries, we started seeing error 1062, > ER_DUP_ENTRY. > > We can get going again after doing an ALTER TABLE to reset the

Re: AUTO_INCREMENT PROBLEM

2002-08-16 Thread Dan Nelson
In the last episode (Aug 17), delz said: > I'm using phpmyadmin to create database on Mysql server. I want my > idx to start at 1800 then implement auto increment. How do i do it > using phpmyadmin? send the following command: ALTER TABLE mytable AUTO_INCREMENT = 1700; In general, phpmyadmin qu

Re: AUTO_INCREMENT problem even worse!

2002-07-10 Thread Steve Hay
[EMAIL PROTECTED] wrote: >Your message cannot be posted because it appears to be either spam or >simply off topic to our filter. To bypass the filter you must include >one of the following words in your message: > >sql,query > >If you just reply to this message, and include the entire text of it

RE: AUTO_INCREMENT problem in table

2001-07-25 Thread Carsten H. Pedersen
> Dear Peter, > > > Even if i delete the record where id=65535 > > DELETE FROM cust WHERE id=65535 > > AUTO_INCREMENT starts with 65535 and i cant add any more records. > > Sad, but true, MySQL "remembers" the biggest number inserted into an > auto_increment column. If you delete the row in ques

Re: AUTO_INCREMENT problem in table

2001-07-25 Thread ryc
ay, July 25, 2001 12:15 PM Subject: Re: AUTO_INCREMENT problem in table > Dear Peter, > > > Even if i delete the record where id=65535 > > DELETE FROM cust WHERE id=65535 > > AUTO_INCREMENT starts with 65535 and i cant add any more records. > > Sad, but true, MySQL &qu

Re: AUTO_INCREMENT problem in table

2001-07-25 Thread Stefan Hinz
Dear Peter, > Even if i delete the record where id=65535 > DELETE FROM cust WHERE id=65535 > AUTO_INCREMENT starts with 65535 and i cant add any more records. Sad, but true, MySQL "remembers" the biggest number inserted into an auto_increment column. If you delete the row in question, the next i

Re: AUTO_INCREMENT problem in table

2001-07-25 Thread Paul DuBois
At 4:47 PM +0200 7/25/01, Peter Wiherkoski wrote: >Hi, got a problem: > >My table (part of it) looks like this: >CREATE TABLE cust ( >id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT, >name CHAR(30) NOT NULL, >PRIMARY KEY (id) >); > >When i type >INSERT INTO cust VALUES(NULL,"Peter"); >the value of id

Re: auto_increment problem with mysql 3.23.32

2001-02-28 Thread Bard dZen
I've had the same issue. The problem, as I saw it, was that I inserted a negatvie value into the ID field. For some reason, it "rolls" to the highest possible positive numeric value if a negative number is used in the ID field. I made the field unsigned to address this issue in mySQL, but, t

Re: auto_increment problem with mysql 3.23.32

2001-02-15 Thread Sinisa Milivojevic
William R. Mussatto writes: > On Wed, 14 Feb 2001, Sinisa Milivojevic wrote: > > can an auto_increment column also have the attribute "unsigned" safely? > > Sincerely, > > William Mussatto, Senior Systems Engineer > CyberStrategies, Inc > ph. 909-920-9154 ext. 27 > > Yes it can.

Re: auto_increment problem with mysql 3.23.32

2001-02-14 Thread William R. Mussatto
On Wed, 14 Feb 2001, Sinisa Milivojevic wrote: > Date: Wed, 14 Feb 2001 16:21:31 +0200 (EET) > From: Sinisa Milivojevic <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: Re: auto_increment problem with mysql 3.23.32 snip.. > > Hi!

Re: auto_increment problem with mysql 3.23.32

2001-02-14 Thread Gábor Lénárt
On Wed, Feb 14, 2001 at 04:21:31PM +0200, Sinisa Milivojevic wrote: > Hi! > > The above is actually documented behaviour. I've just realized that it's true (checked). But it was supported by older mysql versions and now I'm getting stuck with the old tables (MyISAM). > > Entering negative valu

Re: auto_increment problem with mysql 3.23.32

2001-02-14 Thread Sinisa Milivojevic
Gábor Lénárt writes: > On Wed, Feb 14, 2001 at 02:38:11PM +0200, Sinisa Milivojevic wrote: > > Hi! > > > > I have just tested your case on my Linux and it worked just fine. > > > > What OS is that and are you using our binaries. If not, please do. > > OK, I will (but it takes some time

Re: auto_increment problem with mysql 3.23.32

2001-02-14 Thread Gábor Lénárt
On Wed, Feb 14, 2001 at 02:38:11PM +0200, Sinisa Milivojevic wrote: > Hi! > > I have just tested your case on my Linux and it worked just fine. > > What OS is that and are you using our binaries. If not, please do. OK, I will (but it takes some time to download). Till that I have got a more acc

Re: auto_increment problem with mysql 3.23.32

2001-02-14 Thread Sinisa Milivojevic
Gábor Lénárt writes: > Hi, > > It's me again ;-) Now I have got a very serious problem. I've just downloaded > 3.23.32 and compile then run it without any major trouble. BUT my headache > is about this: > > > mysql> insert into cikk values (NULL,'Beta','','','','','N','','',NULL,0,0,0,0