首页 话题 小组 问答 好文 用户 我的社区 域名交易 唠叨

[Mysql]mysql重建主键ID

发布于 2024-10-15 14:53:42
0
175


删除原有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);
评论
一个月内的热帖推荐
九秘
Lv.1种子选手

209

帖子

18

小组

362

积分

赞助商广告
站长交流