What is wrong with my SQL here? #1089 - Incorrect prefix key

后端 未结 13 1889
迷失自我
迷失自我 2020-12-01 02:21
CREATE TABLE `table`.`users` (
    `id` INT(11) NOT NULL AUTO_INCREMENT,
    `username` VARCHAR(50) NOT NULL,
    `password` VARCHAR(50) NOT NULL,
    `dir` VARCHAR(         


        
13条回答
  •  温柔的废话
    2020-12-01 03:11

    Problem is the same for me in phpMyAdmin. I just created a table without any const. Later I modified the ID to a Primary key. Then I changed the ID to Auto-inc. That solved the issue.

    ALTER TABLE `users` CHANGE `ID` `ID` INT(11) NOT NULL AUTO_INCREMENT;
    

提交回复
热议问题