Mysql中ERROR 1075 (42000): Incorrect table definition; there can be only on auto column and it must

我在Mysql中想往表里加入一个带有auto_increment字段的列,显示报错ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key。

Mysql中ERROR 1075 (42000): Incorrect table definition; there can be only on auto column and it must_第1张图片

报错的意思是:不正确的表定义;只有一个自动列,必须将其定义为键。

经过认真了解后,得知auto_increment字段必须在int类型且为primary key的列才可以使用,于是做出以下修改:

Mysql中ERROR 1075 (42000): Incorrect table definition; there can be only on auto column and it must_第2张图片

添加成功。

你可能感兴趣的:(Mysql中ERROR 1075 (42000): Incorrect table definition; there can be only on auto column and it must)