索引

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);

收藏 0

评论 0

本文标题: MYSQL重建主键索引

本文链接: https://crm.yallacn.com/jiaocheng/382.html (转载时请注明来源链接)

本文说明: 有问题或投稿请发送至: 邮箱/service@zhimatong.com    QQ/1174742835

特别鸣谢: 如果您觉得本文对您有帮助,请给我们一个小小的赞,收藏本文更利于反复学习哦!

联系
顾问

交流群 购物车
账号登录

没有账号?立即注册

忘记密码

登录即同意用户协议没有账号? 立即注册
账号注册
我已阅读并同意用户协议
立即注册
注册即同意用户协议已有账号? 立即登录
找回密码

操作步骤:邮箱验证->设置新密码

注册即同意用户协议已有账号? 立即登录