ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key

删除主键约束时报错,

alter table 表名 drop primary key;

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

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

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

posted on 2020-12-01 17:17  刀锋93  阅读(1354)  评论(0编辑  收藏  举报

导航