重置表的自增主键: alter table 表名 auto_increment= 起始值 修改表的主键从1开始: SET @rownum = 0; UPDATE 表名 SET id = @rownum := @rownum +1;