增加主键
alter table humanidentity.citycode add primary key(adcode);
删除主键
alter table humanidentity.citycode drop primary key;
更换主键
alter table humanidentity.citycode drop primary key;alter table humanidentity.citycode add primary key(adcode);
检查效果
desc humanidentity.citycode;
参考文档:
mysql 如何修改 删除 添加 表主键 - 月末終北 - 博客园 (cnblogs.com)https://www.cnblogs.com/quchengjie/p/10421665.html