一、建表的时候设置
CREATE TABLE IF NOT EXISTS `Student`(
`id` INT UNSIGNED AUTO_INCREMENT,
`name` INT(11),
PRIMARY KEY ( `id` )
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
二、建表后修改
alter table Student modify id int auto_increment;
CREATE TABLE IF NOT EXISTS `Student`(
`id` INT UNSIGNED AUTO_INCREMENT,
`name` INT(11),
PRIMARY KEY ( `id` )
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
alter table Student modify id int auto_increment;