更新自增id
alter table TestCase AUTO_INCREMENT = 495;
查看sql表进程
// 命令行
SHOW FULL PROCESSLIST;
杀死sql进程
// 命令行
kill process
mysql获取自增值
SELECT auto_increment FROM information_schema.tables WHERE table_name='表名'
mysql 自增id 重置
-- 1、重置已有数据主键
SET @rownum = 0;
UPDATE table_name SET id = @rownum := @rownum +1;
-- 2、修改自增主键,beginIndex为查询出来的最大id+1
SELECT max(id)+1 from table_name;
alter table table_name auto_increment= beginIndex;
标签:自增,name,拓展,主键,MySQL,table,rownum,id
From: https://www.cnblogs.com/dengz/p/17485749.html