Ittay,

ALTER TABLE ... AUTO_INCREMENT=...

does not work with InnoDB type tables.

http://www.innodb.com/ibman.html#InnoDB_restrictions

"
For an AUTO_INCREMENT column one must always define a key to the table, and
that key must contain just the auto-increment column. InnoDB does not
support AUTO_INCREMENT=... in a CREATE TABLE statement. This clause is used
to set the first value for an auto-increment column (the default first value
is 1). Workaround: insert the first row with the auto-inc column value
explicitly specified. After that InnoDB starts incrementing from that value.
"

Best regards,

Heikki Tuuri
Innobase Oy
http://www.innodb.com
Transactions, foreign keys, and a hot backup tool for MySQL
Order MySQL technical support from https://order.mysql.com/



----- Original Message ----- 
From: "Ittay Freiman" <[EMAIL PROTECTED]>
Newsgroups: mailing.database.mysql
Sent: Tuesday, July 15, 2003 8:44 AM
Subject: alter table 'table' auto_increment = # doesn't work


> i cannot set auto_increment to start from anything other than 1:
>
> mysql> create table test (id int unsigned not null auto_increment primary
key);
>
> mysql> alter table test auto_increment=2;
>
> mysql> insert into test() values();
>
> mysql> select * from test;
> +----+
> | id |
> +----+
> |  1 |
> +----+
> 1 row in set (0.00 sec)
>
>
> please help,
> ittay



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

Reply via email to