MYSQL重建主键索引

删除原有ID列:

alter table order_shbk drop id;

重建ID列,现在ID全部为0 

alter table order_shbk add id int(11) not null first;

设置ID主键自增:

alter table order_shbk modify column id int( 11 ) not null auto_increment,add primary key(id);

alter table order_shbk drop id;

alter table order_shbk add id int(11) not null first;

alter table order_shbk modify column id int( 11 ) not null auto_increment,add primary key(id);

猜你喜欢

转载自blog.csdn.net/weixin_33955681/article/details/90936029