mysql 删除主键错误

删除主键约束时报错,

alter table 表名 drop primary key;

原因:因为设置了自增,需要先删除自增

删除自增:alter table 表名 modify 列 类型(长度);

添加自增:alter table 表名 modify 列 类型(长度) auto_increment;

posted @ 2022-04-21 20:06  忆笙歌  阅读(245)  评论(0)    收藏  举报