1.给某字段添加索引
alter table test add index idx_id(`id`);
2.删除某表主键
alter table test drop primary key;
3.给已经存在的表添加主键
alter table test add primary key (`id`);
4.添加自增列并设置该列为主键
alter table test add auto_id bigint not null auto_increment primary key;
阅读(385) | 评论(0) | 转发(0) |