【问题标题】:Auto Increment Issue - Incrementing By 10 [duplicate]自动增量问题 - 增加 10 [重复]
【发布时间】:2013-11-14 06:01:54
【问题描述】:

我的数据库遇到了一个奇怪的问题。

我的数据库(所有表)的所有自动递增字段都递增 10。

以前它工作正常(递增 1)。现在它开始增加 10。

表 1

另一张桌子

【问题讨论】:

标签: php mysql sql codeigniter


【解决方案1】:

auto_increment_increment系统变量设置为1。

SET @@auto_increment_increment=1
SET GLOBAL auto_increment_increment=1;

【讨论】:

    【解决方案2】:

    是这样的:

    SET @@auto_increment_increment=1;

    或针对特定表:

    ALTER TABLE users AUTO_INCREMENT =1;

    或者你可以参考w3school

    【讨论】:

      【解决方案3】:

      是的,您可以将 auto_increment_increment 变量设置为 1

      SET @@auto_increment_increment=1

      SET GLOBAL auto_increment_increment=1;

      在mysql中它肯定会工作。

      【讨论】:

        猜你喜欢
        • 2016-02-05
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-04-08
        • 1970-01-01
        相关资源
        最近更新 更多