mysql> SET @auto_increment_increment=10;
mysql> SHOW VARIABLES LIKE 'auto_inc%';
+--------------------------+-------+
| Variable_name | Value |
+--------------------------+-------+
| auto_increment_increment | 10 |
| auto_increment_offset | 1 |
+--------------------------+-------+
2 rows in set (0.01 sec)
+--------------------------+-------+
| Variable_name | Value |
+--------------------------+-------+
| auto_increment_increment | 10 |
| auto_increment_offset | 1 |
+--------------------------+-------+
2 rows in set (0.01 sec)
本文介绍如何在MySQL中设置自增字段的增量值。通过使用SQL命令SET @auto_increment_increment,可以将自增字段的增量从默认的1更改为指定值。示例中将其设置为10,并展示了使用SHOW VARIABLES LIKE 'auto_inc%'命令来验证设置。
4482

被折叠的 条评论
为什么被折叠?



