Mysql rewritten primary Key

Delete the original primary key fields (such as id)

alter table table_name drop id;

Add a primary key, increment, in the first place

alter table table_name add id int(11) primary key auto_increment first;

Guess you like

Origin www.cnblogs.com/mc-r/p/12019867.html