auto_increment设置mysql int型并且主键字段为自动增长字段。
如:
建表
create table tang
(
id int auto_increment,
name varchar(20) not null,
password varchar(20)
);
插入数据
insert into tang(name,password) values('tang1','tang');
insert into tang(name,password) values('tang2','tang');
insert into tang(name,password) values('tang3','tang');
insert into tang(name,password) values('tang4','tang');
insert into tang(name,password) values('tang'5,'tang');