您现在的位置是: 首页 > MySQL MySQL
mysql重建主键ID
冬寂
2020-08-06 13:33:10
【MySQL】
4011人已围观
删除原有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);
上一篇: NOSQL数据库之 - Redis(1)
下一篇: MYSQL取随机数据
相关文章
点击排行

站长推荐

猜你喜欢
- MySQL ANY_VALUE() 函数
- MySQL 随机排序 ORDER BY RAND() 性能优化
- 如何在网上向人求助
- 提问的智慧
- 执行count(1)、count(*) 与 count(列名) 到底有什么区别?
- 韦伯天文望远镜将会改写宇宙历史,如果它能正常工作的话(The Webb Space Telescope Will Rewrite Cosmic History. If It Works.)
- 韦伯太空望远镜将改写宇宙历史(The Webb Space Telescope Will Rewrite Cosmic History. If It Works.)
- 韦伯太空望远镜将改写宇宙历史(The Webb Space Telescope Will Rewrite Cosmic History. If It Works.)
- 《人类动物园》:为什么说都市是人类动物园?
- 对话罗永浩:再创业可能后悔,不再创业百分之百后悔