查看配置

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)

【MySQL】自增步长调整的更多相关文章

  1. mysql 的增删改查

    数据库的基本流程就是先看你的数据库中的库都是哪些:show databases; 然后再进入相应的库进行操作  :  use+进入的库/表 切换路径 查看这个库内的所有的表: show tabales ...

  2. (转)mysql自增列导致主键重复问题分析

    mysql自增列导致主键重复问题分析...  原文:http://www.cnblogs.com/cchust/p/3914935.html 前几天开发童鞋反馈一个利用load data infile ...

  3. MySQL自增属性auto_increment_increment和auto_increment_offset

    MySQL的系统变量或会话变量auto_increment_increment(自增步长)和auto_increment_offset(自增偏移量)控制着数据表的自增列ID. mysql> sh ...

  4. MySQL之增删改查之

    MySQL之增删改查   前言:以下是MySQL最基本的增删改查语句,很多IT工作者都必须要会的命令,也是IT行业面试最常考的知识点,由于是入门级基础命令,所有所有操作都建立在单表上,未涉及多表操作. ...

  5. MySQL AutoIncrement--自增锁模式

    自增锁模式 在MYSQL 5.1.22版本前,自增列使用AUTO_INC Locking方式来实现,即采用一种特殊的表锁机制来保证并发插入下自增操作依然是串行操作,为提高插入效率,该锁会在插入语句完成 ...

  6. MySql之增删改查 · YbWork's Studio

    前提:在进行"增删改查"的操作之前,先建立一个包含数据表student的数据库(具体操作可以见MySQL之最基本命令): 1."增"--添加数据 1.1 为表中 ...

  7. MySQL自增ID 起始值 修改方法

    在mysql中很多朋友都认为字段为AUTO_INCREMENT类型自增ID值是无法修改,其实这样理解是错误的,下面介绍mysql自增ID的起始值修改与设置方法. 通常的设置自增字段的方法: 创建表格时 ...

  8. Java连接MySQL数据库增删改查通用方法

    版权声明:本文为博主原创文章,未经博主允许不得转载. Java连接MySQL数据库增删改查通用方法 运行环境:eclipse+MySQL 以前我们Java连接MySQL数据库都是一个数据库写一个类,类 ...

  9. node.js中对 mysql 进行增删改查等操作和async,await处理

    要对mysql进行操作,我们需要安装一个mysql的库. 一.安装mysql库 npm install mysql --save 二.对mysql进行简单查询操作 const mysql = requ ...

随机推荐

  1. xgboost:

    https://www.zybuluo.com/Dounm/note/1031900 GBDT算法详解 http://mlnote.com/2016/10/05/a-guide-to-xgboost- ...

  2. Python进阶-V 迭代器(Iterator)、生成器(Generator)函数

    一.迭代器 1.可循环的有哪些,即可用for语句或者while语句的数据类型有哪些? 字符串(str).列表(list).元组(tuple).字典(dic).集合(set).枚举类(enumerate ...

  3. Shell编程——位置参数变量

    1. (1)创建Shell脚本: (2)赋予执行权限: (3)执行Shell脚本: (4)对脚本赋值后执行脚本: $n:n为数字,$0代表命令本身,$1-9代表第一到第九个参数,十以上的参数用大括号包 ...

  4. 数据结构——顺序队列(sequence queue)

    /* sequenceQueue.c */ /* 顺序队列 */ #include <stdio.h> #include <stdlib.h> #include <std ...

  5. Linux系统运维笔记,CentOS 7.4防火墙配置

    1.查看firewall服务状态 systemctl status firewalld 2.查看firewall的状态 firewall-cmd --state 3.开启.重启.关闭.firewall ...

  6. Spring mvc 前后台通过json交互【转】

    原文转自:https://www.cnblogs.com/zhaojiankai/p/8184596.html 本节内容: @RequestBody @ResponseBody 请求json,响应js ...

  7. 微信小程序前端调用后台方法并获取返回值

    wxml代码 <wxs src="../../wxs/string.wxs" module="tools" /> <!-- 调用tools.i ...

  8. C# HTTP系列5 HttpWebResponse.StatusCode属性

    系列目录     [已更新最新开发文章,点击查看详细] HttpWebResponse.StatusCode 属性获取响应的状态.对应 HttpStatusCode 枚举值之一. HttpStatus ...

  9. 微软 Azure DevOps Server 2019 Update 1 (TFS 2019.1)

    1.概述 微软在2019年5月发布Azure DevOps Server 2019后不到2个月的时间里,就快速准备好了第一个升级包(2019 Update 1),并计划在几周后发布正式版本.也许你还没 ...

  10. HTML连载28-标签的权重

    一.什么是优先级的权重 1.作用:当多个选择器混合在一起的时候,我们可以通过计算权重来判断谁的优先级最高. 2.权重的计算规则 公共代码: <body> <div id=" ...