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解决_第1张图片

 提示的意思是我们建表的时候,如果自增一定要设置一个key,手残没有设主键

`id` BIGINT(20) NOT NULL AUTO_INCREMENT,

改一下:

 `id` BIGINT(20) NOT NULL AUTO_INCREMENT PRIMARY,

或者:

`id` BIGINT(20) NOT NULL AUTO_INCREMENT,

PRIMARY KEY (`id`)

解决

自增一定要设主键!自增一定要设主键!自增一定要设主键!

你可能感兴趣的:(数据库)