更新表字段为递增 START TRANSACTION; SET @num := 20000; //起始值 UPDATE grade SET id = (@num := @num + 1) //每次加一 WHERE `id` = ''; COMMIT;