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

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -