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

mysql, php, phpmyadmin, sql

Solution

Define your auto increment column as a primary key.

CREATE TABLE  `Acc_inst` 
(    
   `inst_ID` INTEGER NOT NULL AUTO_INCREMENT ,
   `inst_Name` VARCHAR( 255 ) ,
   `Inst_Ws` VARCHAR( 255 ) ,
   `inst_ph` VARCHAR( 255 ) ,
   `inst_Fx` VARCHAR( 255 ) ,
   `Inst_E` VARCHAR( 255 ) ,
   PRIMARY KEY `inst_ID`(`inst_ID`)
) ENGINE = INNODB DEFAULT CHARSET = utf8;

Problem

Hi, I'm importing mySql database (which was originally an access database) into phpmyadmin and its giving me this error: SQL query: ``` CREATE TABLE `Acc_inst` ( `inst_ID` INTEGER NOT NULL AUTO_INCREMENT , `inst_Name` VARCHAR( 255 ) , `Inst_Ws` VARCHAR( 255 ) , `inst_ph` VARCHAR( 255 ) , `inst_Fx` VARCHAR( 255 ) , `Inst_E` VARCHAR( 255 ) ) ENGINE = INNODB DEFAULT CHARSET = utf8; ``` MySQL said: Documentation 1075 - Incorrect table definition; there can be only one auto column and it must be defined as a key -- There is in fact only on auto increment column and it is defined as a primary key so I dont get why its giving me this error

Original source