原链接   mysql数据自增ID为2的解决办法

1. 查看配置

       show variables like '%increment%';

      mysql数据库中自增ID不自增1的解决办法

 

 

        如上,如果auto_increment_increment和auto_increment_offset不为1,就需要重新设置一下这两个值了。

 

2. 修改auto_increment_increment或auto_increment_offset

    如果auto_increment_increment的value不为1,则执行如下命令:

        set @@global.auto_increment_increment = 1; 

        set @@auto_increment_increment =1;

    如果auto_increment_offset的value不为1,则执行如下命令:

        set @@global.auto_increment_offset =1;
        set @@auto_increment_offset =1;

    

 

相关文章:

  • 1970-01-01
  • 2022-03-11
  • 2022-01-12
  • 2022-12-23
  • 2022-01-02
  • 2021-10-26
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2023-03-18
相关资源
相似解决方案