zoukankan      html  css  js  c++  java
  • 【MySQL】自增步长调整

    查看配置
    
    show variables like '%increment%';
    
    如果:
    
    auto_increment_increment=2
    
    执行:
    set @@global.auto_increment_increment = 1; 
    set @@auto_increment_increment =1;
    
    如果:
    
    auto_increment_offset=2
    
    执行:
    
    set @@global.auto_increment_offset =1;
    set @@auto_increment_offset =1;
    ————————————————
    版权声明:本文为CSDN博主「qq_33508876」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
    原文链接:https://blog.csdn.net/qq_33508876/article/details/79725543
    
    mysql> show variables like '%increment%';
    +-----------------------------+-------+
    | Variable_name               | Value |
    +-----------------------------+-------+
    | auto_increment_increment    | 2     |
    | auto_increment_offset       | 1     |
    | div_precision_increment     | 4     |
    | innodb_autoextend_increment | 64    |
    +-----------------------------+-------+
    4 rows in set (0.03 sec)
    
    mysql> set @@global.auto_increment_increment = 1;
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> show variables like '%increment%';
    +-----------------------------+-------+
    | Variable_name               | Value |
    +-----------------------------+-------+
    | auto_increment_increment    | 2     |
    | auto_increment_offset       | 1     |
    | div_precision_increment     | 4     |
    | innodb_autoextend_increment | 64    |
    +-----------------------------+-------+
    4 rows in set (0.07 sec)
    
    mysql> set @@auto_increment_increment =1;
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> 
    mysql> show variables like '%increment%';
    +-----------------------------+-------+
    | Variable_name               | Value |
    +-----------------------------+-------+
    | auto_increment_increment    | 1     |
    | auto_increment_offset       | 1     |
    | div_precision_increment     | 4     |
    | innodb_autoextend_increment | 64    |
    +-----------------------------+-------+
    4 rows in set (0.04 sec)
    
    
  • 相关阅读:
    2020牛客暑期多校训练营(第二场)Interval 网络流平面图转化成最短路
    [P4001 [ICPC-Beijing 2006]狼抓兔子]
    [2020牛客暑期多校训练营(第二场)Greater and Greater]
    [2020牛客暑期多校训练营(第二场)All with Pairs]
    2020牛客暑期多校训练营(第二场)[ Boundary]
    数据结构的特性
    centos7 pgsql启动异常问题
    go实现服务授权
    go 使用线程池做请求限流
    go实现爬虫
  • 原文地址:https://www.cnblogs.com/liudianer/p/11693738.html
Copyright © 2011-2022 走看看