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

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -