MySQL中自增ID起始值修改方法
SQL
0
2023年11月20日 每日一猜答案:。 答案:ABC。 每日一猜答案分析:
在实际测试工作过程中,有时因为生产环境已有历史数据原因,需要测试环境数据id从某个值开始递增,此时,我们需要修改数据库中自增ID起始值,下面以MySQL为例: 表名:users; 建表时添加:create table users(id int auto_increment primary key,666);
alter table users add id int auto_increment primary key; #将自增字段设置为primary key alter table users AUTO_INCREMENT=10000;
版权声明:除非特别标注原创,其它均来自互联网,转载时请以链接形式注明文章出处。