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


THE END

文章版权:作者:demo  来源:芝麻通  

免责声明:本站提供的一切软件、插件、教程和内容信息仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络收集整理,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑或手机中彻底删除上述内容。如果您喜欢该程序和内容,请支持正版,购买注册,得到更好的正版服务。我们非常重视版权问题,如有侵权请邮件与我们联系处理。敬请谅解!

本文最后更新于 2022-08-12 13:51:30,如果你的问题还没有解决,可以加入建站交流群和群友们一起讨论。

评论区