前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >ERROR 1075 (42000): Incorrect table definition; there can be only one auto colum

ERROR 1075 (42000): Incorrect table definition; there can be only one auto colum

原创
作者头像
用户14527
发布2022-07-19 22:47:19
6440
发布2022-07-19 22:47:19
举报
文章被收录于专栏:supremesupreme

问题:

id0 字段为主键,自增,操作删除主键就会报错。

代码语言:javascript
复制
mysql> alter table bigdata__bak drop primary key;
ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key

修改为唯一约束

代码语言:javascript
复制
mysql> alter table bigdata__bak add unique(id0);
Query OK, 0 rows affected (0.17 sec)
Records: 0  Duplicates: 0  Warnings: 0

再操作即可。

代码语言:javascript
复制
mysql> alter table bigdata__bak drop primary key;
Query OK, 266134 rows affected (0.89 sec)
Records: 266134  Duplicates: 0  Warnings: 0

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 问题:
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档