Mysql - how to set auto-increment to start from zero

前端 未结 2 1446
盖世英雄少女心
盖世英雄少女心 2020-12-16 21:34

I just want my mysql table id(primary key) to start from 0..

As I have seen, I used ALTER TABLE yourtable AUTO_INCREMENT =0 but it starts from 1..What is that I need

2条回答
  •  既然无缘
    2020-12-16 22:15

    You cannot force this to be zero. This is limited by auto_increment_offset server variable. The default value is 1, the range is [1 .. 65535].

    More information: auto_increment_offset, How to set AUTO_INCREMENT step.

提交回复
热议问题