1. 程式人生 > >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解決

在建表的時候報這樣的錯:

 提示的意思是我們建表的時候,如果自增一定要設定一個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`)

解決

自增一定要設主鍵!自增一定要設主鍵!自增一定要設主鍵!