mysql auto_increment 自动增长 创建表时设置自增字段

auto_increment

mysql> create table t20( id int primary key auto_increment, name char(16) )auto_increment=8;
Query OK, 0 rows affected (0.01 sec)
mysql> show create table t20\G;
*************************** 1. row ***************************
       Table: t20
Create Table: CREATE TABLE `t20` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` char(16) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8
1 row in set (0.00 sec)

猜你喜欢

转载自www.cnblogs.com/mingerlcm/p/9852014.html