Hi!

For InnoDB,

CREATE TABLE ... AUTO_INCREMENT=...

works starting from 5.0.3. Until then, you have to use the 'insert + delete a dummy row' method to init the counter.

Best regards,

Heikki Tuuri
Innobase Oy
Foreign keys, transactions, and row level locking for MySQL
InnoDB Hot Backup - a hot backup tool for InnoDB which also backs up MyISAM tables
http://www.innodb.com/order.php


Order MySQL Network from http://www.mysql.com/network/


----- Original Message ----- From: "Rich Lafferty" <[EMAIL PROTECTED]>
Newsgroups: mailing.database.myodbc
Sent: Wednesday, February 23, 2005 5:19 AM
Subject: Re: set auto_increment does not work?



On Tue, Feb 22, 2005 at 03:46:34PM -0600, Scott Purcell <[EMAIL PROTECTED]> wrote:
Hello,

ALTER TABLE tbl_name AUTO_INCREMENT = 1000
will start your records at 1000

But it does not work for myself. How can I get the auto_increment to
begin at a set starting point? I know I could insert a bogus record,
but it just seems sloppy.

Does it work if you use MyISAM tables? Just a hunch, based on something I ran into in 2002:

 http://www.lafferty.ca/stuff/misc/innodb-autoincrement-bug

but never had time/reason to investigate further (MyISAM proved
sufficient in that application). If you can duplicate what I
saw then it might be worth following up with MySQL AB after testing
in the latest MySQL release.

 -Rich

--
Rich Lafferty --------------+-----------------------------------------------
Ottawa, Ontario, Canada | Save the Pacific Northwest Tree Octopus!
http://www.lafferty.ca/ | http://zapatopi.net/treeoctopus.html
[EMAIL PROTECTED] -----------+-----------------------------------------------


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




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



Reply via email to