MySQL的auto_increment减5?

MySQL的auto_increment减5?

问题描述:

我遇到了一个非常非常非常奇怪的mysql问题.

I'm running into a really, really, really weird problem with mysql.

我有一个主键"id".设置为自动递增.问题是,第一个条目从"3"开始.并且每个新条目增加5,因此下一个条目的ID是8,下一个是13,然后是18,依此类推.这真是愚蠢.为什么它不像应该的那样仅增加1?为什么从3开始呢?

I have a primary key, "id". It's set to auto increment. Problem is, first entry started at "3". And every new entry increases by 5, so the next entry's id is 8, the next is 13, then 18, so on. This is stupid. Why isn't it just incrementing by 1, like it should be? And why is it starting at 3???

我缺少某处的设置吗?我正在使用phpmyadmin,如果有帮助的话.

Is there some setting somewhere I'm missing? I'm using phpmyadmin, if that helps.

有一个my.cnf配置:

There's a my.cnf configuration for that: auto_increment_increment. It's used for master-master server setups to prevent the same key from being defined twice by two different servers. So using that coupled with auto_increment_offset, it allows each server to always generate unique ids...

因此,从您的描述来看,听起来像您这样:

So, from what you're describing, it sounds like you have this:

auto_increment_increment = 5
auto_increment_offset = 3