Mysql tutorial custom primary key step size Method
Create table if not exists 'useradmin '(
'Id' int (4) not null auto_increment,
'Username' varchar (20) default NULL,
'Userpass' varchar (40) default NULL,
'Logins' int (4) not null default '0' comment' login times ',
'Logintime' timestamp not null default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
'Mid 'Char (1) not null default '0 ',
Primary key ('id ')
) ENGINE = InnoDB default charset = utf8 AUTO_INCREMENT = 4;
SET @ auto_increment_increment = 10;
O Query OK, 0 rows affected (0.00 sec)
O
O mysql> show variables like 'Auto _ inc % ';
O + -------------------------- + ------- +
O | Variable_name | Value |
O + -------------------------- + ------- +
O | auto_increment_increment | 10 |
O | auto_increment_offset | 1 |
O + -------------------------- + ------- +
O 2 rows in set (0.01 sec)
O
O mysql> insert into useradmin VALUES ('www. bKjia. c0m'), (NULL );
O Query OK, 4 rows affected (0.00 sec)
O Records: 4 Duplicates: 0 Warnings: 0
O
O mysql> SELECT col FROM autoinc1;
O + ----- +
O | col |
O + ----- +
O | 1 |
O | 11 |
O | 21 |
O | 31 |
O + ----- +
O 4 rows in set (0.00 sec)