Oracle 5.0 Reference Manual page 1469

Table of Contents

Advertisement

Replication and Binary Logging Options and Variables
mysql>
INSERT INTO autoinc1 VALUES (NULL), (NULL), (NULL), (NULL);
Query OK, 4 rows affected (0.00 sec)
Records: 4
Duplicates: 0
mysql>
SELECT col FROM autoinc1;
+-----+
| col |
+-----+
|
1 |
|
11 |
|
21 |
|
31 |
|
35 |
|
45 |
|
55 |
|
65 |
+-----+
8 rows in set (0.00 sec)
The values shown for
auto_increment_offset
The greatest value present in the
in the
AUTO_INCREMENT
results are as shown for the
It is not possible to confine the effects of these two variables to a single table, and thus they do
not take the place of the sequences offered by some other database management systems; these
variables control the behavior of all
If the global value of either variable is set, its effects persist until the global value is changed or
overridden by setting the session value, or until
new value affects
AUTO_INCREMENT
current user for the duration of the session, unless the values are changed during that session.
The
auto_increment_increment
1. See
Section 16.4.1.1, "Replication and
auto_increment_increment
5.0.46. Previously, setting it when using MySQL Cluster tables produced unpredictable results.
auto_increment_offset
Version Introduced
Command-Line Format
Option-File Format
Option Sets Variable
Variable Name
Variable Scope
Dynamic Variable
This variable was introduced in MySQL 5.0.2. Its default value is 1. For particulars, see the
description for
auto_increment_increment
auto_increment_offset
5.0.46. Previously, setting it when using MySQL Cluster tables produced unpredictable results.
Warnings: 0
auto_increment_increment
[1449]
generate the series 5 +
column prior to the
col
series is 35, so the inserted values for
query.
SELECT
AUTO_INCREMENT
columns for all tables into which new rows are inserted by the
[1446]
variable was added in MySQL 5.0.2. Its default value is
AUTO_INCREMENT".
[1446]
is supported for use with
[1449]
5.0.2
--auto-increment-offset[=#]
auto_increment_offset
Yes,
auto_increment_offset
auto_increment_offset
Global, Session
Yes
Permitted Values
Type
numeric
Default
1
Range
1 .. 65535
[1449]
is supported for use with
1449
[1446]
and
× 10, that is, [5, 15, 25, 35, 45, ...].
N
is 31, and the next available value
INSERT
begin at that point and the
col
columns in all tables on the MySQL server.
is restarted. If the local value is set, the
mysqld
tables beginning with MySQL
NDB
[1449]
[1446].
tables beginning with MySQL
NDB

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents