create database db; use db; CREATE TABLE `sb` ( `id` int(11) NOT NULL auto_increment , `k` int(10) unsigned NOT NULL DEFAULT '0', `c` char(120) NOT NULL DEFAULT '', `pad` char(60) NOT NULL DEFAULT '', PRIMARY KEY (`id`), KEY `k_1` (`k`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci MAX_ROWS=1000000; let $loop = 129; while ($loop) { insert into sb(id, k, c, pad) values(NULL, 1, 'test', 'test'); dec $loop; } alter table sb modify id int not null; alter table sb drop primary key, add column c1 int not null auto_increment, add key(c1);