1,删除原有主键:ALTER TABLE `table_name` DROP `id`;2,添加新主键字段:ALTER TABLE `table_name` ADD `id` MEDIUMINT( 8 ) NOT NULL FIRST;3,设置新主键:ALTER TABLE `table_name` MODIFY COLUMN `id` MEDIUMINT( 8 ) NOT NULL AUTO_INCREMENT,ADD PRIMARY KEY(id);