我有一个带有自动递增列的表.我需要将其中一行设置为1000而不再触摸它,但现在我已将其设置为1000,自动增量保持从1001开始并拒绝从1开始.有没有办法解决这个问题?最佳答案你不能:
To change the value of the
auto_INCREMENT counter to be used for
new rows,do this:ALTER table t2 auto_INCREMENT = value;
You cannot reset the counter to a
value less than or equal to any that
have already been used. For MyISAM,if
the value is less than or equal to the
maximum value currently in the
auto_INCREMENT column,the value is
reset to the current maximum plus one.
For InnoDB,if the value is less than
the current maximum value in the
column,no error occurs and the
current sequence value is not changed.
http://dev.mysql.com/doc/refman/5.1/en/alter-table.html 总结
以上是内存溢出为你收集整理的当大量数字已存在时重置MySQL auto_increment?全部内容,希望文章能够帮你解决当大量数字已存在时重置MySQL auto_increment?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)