当前位置: 移动技术网 > IT编程>数据库>Mysql > 【Mysql】自增步长调整

【Mysql】自增步长调整

2019年10月17日  | 移动技术网IT编程  | 我要评论
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)

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网