zoukankan      html  css  js  c++  java
  • mysql:there can be only one auto column...

    转自:https://blog.csdn.net/gao_zhennan/article/details/79099940

    一,问题发生
    今天(18/1/18),我在尝试删除一个定义为auto_increment的主键时(所用语句:alter table test
    drop primary key)结果报了如下错误。

    Incorrect table definition; there can be only one auto column and it must be defined as a key
    翻译:错误的表定义,一个表只能有一个自增列并且该列必须是主键。
    二,实验
    自增的列必须是主键

    如图:我定义了一个自增,没有定义主键,报错。

    修改为主键后成功。
    三 最终结论
    自增的属性列必须是主键
    补充:自增的属性列必须定义为数值(int等)类型。
    ————————————————
    版权声明:本文为CSDN博主「明月几时有666」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
    原文链接:https://blog.csdn.net/gao_zhennan/article/details/79099940

  • 相关阅读:
    E. You Are Given Some Strings...
    神奇函数
    AC自动机再加强版
    AC自动机2
    AC自动机
    three arrays
    permutation 2
    string matching
    permutation 1
    equation
  • 原文地址:https://www.cnblogs.com/sharpest/p/14950984.html
Copyright © 2011-2022 走看看