Change the step auto_increment fields increment by

后端 未结 4 1377
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-09 20:04

How do I change the amount auto_increment fields in MySQL increment by from the default (1) to n?

4条回答
  •  爱一瞬间的悲伤
    2020-12-09 20:48

    You can change it using ALTER TABLE:

    ALTER TABLE table AUTO_INCREMENT = n;
    

    Or if you want to do set it from start:

    CREATE TABLE table (...) AUTO_INCREMENT = n;
    

提交回复
热议问题