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

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

问题

我们在新建数据库表的时候保存会报错,原因就是没有添加约束主键,就会报这个问题。



解决

在对应的表添加约束主键

d2aae443fbb644bb8bf28f09b9b41d5b.png




目录
相关文章
|
10月前
|
关系型数据库 MySQL 数据库
View ‘information_schema.SCHEMATA‘ references invalid table(s) or column(s) or function(s) or define
View ‘information_schema.SCHEMATA‘ references invalid table(s) or column(s) or function(s) or define
140 0
|
存储 关系型数据库 MySQL
超详细!Mysql错误1452 - Cannot add or update a child row: a foreign key constraint fails 原因及解决方法
超详细!Mysql错误1452 - Cannot add or update a child row: a foreign key constraint fails 原因及解决方法
1678 0
超详细!Mysql错误1452 - Cannot add or update a child row: a foreign key constraint fails 原因及解决方法
|
存储 关系型数据库 MySQL
ERROR 1215 (HY000): Cannot add foreign key constraint
ERROR 1215 (HY000): Cannot add foreign key constraint
ERROR 1215 (HY000): Cannot add foreign key constraint
|
SQL 关系型数据库 MySQL
Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT
Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT
|
PHP
【PHP报错集锦】Integrity constraint violation: 1052 Column 'vt_id' in where clause is ambiguous
【PHP报错集锦】Integrity constraint violation: 1052 Column 'vt_id' in where clause is ambiguous
199 0
【PHP报错集锦】Integrity constraint violation: 1052 Column 'vt_id' in where clause is ambiguous
|
SQL 关系型数据库 MySQL
[Err] 1294 - Invalid ON UPDATE clause for 'comment_time' column【详细解决办法】
[Err] 1294 - Invalid ON UPDATE clause for 'comment_time' column【详细解决办法】
620 0
[Err] 1294 - Invalid ON UPDATE clause for 'comment_time' column【详细解决办法】