MySQL: Renaming primary key -
while creating table in mysql i've set wrong name primary key column.
alter table `table_name` change column `old_id_name` `new_id_name` integer auto_increment primary key
after i'm getting
error message: multiple primary key defined
so question how can rename column. note don't want change primary key rename it.
use query this
alter table `table_name` change `old_id_name` `new_id_name` int(11) not null auto_increment;
it change column name of primary key
Comments
Post a Comment