📅  最后修改于: 2022-03-11 14:54:13.198000             🧑  作者: Mango
SET @num := 0;
UPDATE your_table SET id = @num := (@num+1);
ALTER TABLE tableName AUTO_INCREMENT = 1;
/************* OR ***********/
ALTER TABLE table_name AUTO_INCREMENT=1