84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
id=1 name=...id=2 id=6在删除之前插入的id为3,4,5的记录后再插入为什么不是3,而是到6了
You will know why if you use the command.
show create table test2;
The self-increasing value will not be reduced when you delete the record.
test2 | CREATE TABLE `test2` ( `id` int(11) NOT NULL AUTO_INCREMENT, `mouth` int(11) NOT NULL, `num` int(11) NOT NULL, PRIMARY KEY (`id`,`mouth`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=gbk
If you want to modify the self-increment value, please use sql to modify it
alter table test2 auto_increment=4;
The modified primary key auto-increment starting point.
test2 | CREATE TABLE `test2` ( `id` int(11) NOT NULL AUTO_INCREMENT, `mouth` int(11) NOT NULL, `num` int(11) NOT NULL, PRIMARY KEY (`id`,`mouth`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=gbk |
You can refer to mysql auto-increment here, if you want that id 继续从3开始就要手动 INSERT INTO (id,字段2,字段2) VALUES ('3',值1,值2)
id
INSERT INTO (id,字段2,字段2) VALUES ('3',值1,值2)
You will know why if you use the command.
The self-increasing value will not be reduced when you delete the record.
If you want to modify the self-increment value, please use sql to modify it
The modified primary key auto-increment starting point.
You can refer to mysql auto-increment here, if you want that
id
继续从3开始就要手动INSERT INTO (id,字段2,字段2) VALUES ('3',值1,值2)