我只是想知道,如果有一种优雅的方法可以根据当前内容自动将mysql表的自动增量重置为最低值.
例:
mytable中:
1 content of row 1
2 content of row 2
3 content of row 3
4 content of row 4
5 content of row 5
Run Code Online (Sandbox Code Playgroud)
现在自动增量将是6
但在我插入新内容之前,我删除了第3,4和5行.内容如下所示:
1 content of row 1
2 content of row 2
Run Code Online (Sandbox Code Playgroud)
自动增量仍然是6.
这就是问题所在.
我希望自动增量为3,因为根据插入的ID,它是可能的最低值.
如果自动增量"无限增长"并超出12位长整数的范围,则会阻止极大数量.
谢谢你的任何建议!