mysql 给已存在的主键字段设置自增


第一步:给 id 增加auto_increment 属性

alter table tablename modify id int(11) auto_increment;

第二步:给自增值设置初始值

alter table tablename auto_increment=10000;

猜你喜欢

转载自www.cnblogs.com/staring0815/p/10437270.html