版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Norsaa/article/details/78081709
mysql在建表时报故障ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key
create table ll(
-> id int(5) not null auto_increment,
-> name varchar(10),
-> age int(10));
ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key
原因:在设置了自增长列以后需要定义主键列,否则报错
添加主键,修改后成功:
create table ll(
-> id int(5) not null auto_increment,
-> name varchar(10),
-> primary key(id));
Query OK, 0 rows affected (0.81 sec)