热线电话:13121318867

登录
2022-07-04 阅读量: 907
MYSQL 报错 ERROR 1075: Incorrect table definition; there can be only one auto column

MYSQL 报错 ERROR 1075: Incorrect table definition; there can be only one auto column and it must be defined as a key

MySQL发生1075错误是因为,数据库中设置了自增列(auto-Incrementing column),但未将其设置为PRIMARY KEY或UNIQUE KEY,导致执行脚本失败。所以,针对该问题的解决方法:


方法1:将自增列(auto-Incrementing column)设置为主键(PRIMARY KEY);

方法2:如果不将自增列设置为主键,可将其设置为 唯一索引UNIQUE KEY也可解决该问题;




61.6073
0
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子