今天在迁移项目时,操作数据库报错:

Incorrect table definition; there can be only one auto column and it must be defined as a key

我用的是Navicat Premium,而检测表中其他字段发现,并没有另一个设为自增的字段,很是费解,最后在stackoverflow找到这样的答案:

解决,Incorrect table definition; there can be only one auto column and it must be defined as a key

 

意思是:设为自增的字段必须是主键,而我用的是客户端,表是批量从SQLServer复制到MySQL的,导致最后MySQL表中主键丢失,设置id为主键并设为自增后,保存成功,问题解决。

相关文章:

  • 2021-06-20
  • 2021-12-01
  • 2022-12-23
  • 2021-11-05
  • 2022-01-13
  • 2021-09-05
  • 2021-07-07
  • 2021-08-09
猜你喜欢
  • 2021-11-18
  • 2021-06-02
  • 2022-12-23
  • 2022-12-23
  • 2021-10-26
  • 2021-06-10
  • 2021-08-28
相关资源
相似解决方案