MySQL自增ID 起始值 修改方法
在mysql中很多朋友都认为字段为AUTO_INCREMENT类型自增ID值是无法修改,其实这样理解是错误的,下面介绍mysql自增ID的起始值修改与设置方法。
通常的设置自增字段的方法:
创建表格时添加:
create table table1(id int auto_increment primary key,...)
创建表格后添加:
alter table table1 add id int auto_increment primary key #自增字段
一定要设置为primary
转载
2020-08-21 17:00:18 ·
509 阅读 ·
0 评论