MySQL table incrementing by 10 for some reason

末鹿安然 提交于 2019-12-19 19:43:37

问题


The id field in a mysql table is incrementing by 10 (11, 21, 31) for some reason. Here is the table definition:

CREATE TABLE `clients` (
  `id` int(11) NOT NULL auto_increment,
  `first_name` varchar(255) default NULL,
  `last_name` varchar(255) default NULL,
) ENGINE=InnoDB AUTO_INCREMENT=52 DEFAULT CHARSET=utf8;

If I do a simple insert statement in SQL the next ID will be 41.


回答1:


You have auto_increment_increment set to 10, change it back to 1.



来源:https://stackoverflow.com/questions/993800/mysql-table-incrementing-by-10-for-some-reason

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!