Is it possible to add the AUTO_INCREMENT option to a column after creating a table in MySQL 5.1? -
i have table id column make auto-increment column. short of cloning table newly created 1 auto-increment id column, renaming tables, can done?
i know can use alter table add auto-increment column, can add auto_increment option existing column primary key?
yes, can.
if have primary key table, can alter auto_increment
alter table `table` change `column` `column` int( 11 ) not null auto_increment
Comments
Post a Comment