While creating a table I'm getting error #1089- Incorrect Prefix Key.
My sql code :
CREATE TABLE `buildblockz`.`db_user_info` ( `BBZUID` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'User''s Id' , `username` VARCHAR(255) NOT NULL COMMENT 'User''s username' , `password` VARCHAR(255) NOT NULL COMMENT 'User''s password' , `fname` VARCHAR(255) NOT NULL COMMENT 'User''s First Name' , `mname` VARCHAR(255) NULL COMMENT 'User''s Middle Name' , `lname` VARCHAR(255) NOT NULL COMMENT 'User''s Last Name' , `line1` VARCHAR(255) NOT NULL COMMENT 'User''s Address Line 1' , `line2` VARCHAR(255) NULL COMMENT 'User''s Address Line 2' , `city` VARCHAR(255) NOT NULL COMMENT 'User''s Address City' , `state` VARCHAR(255) NOT NULL COMMENT 'User''s Address State' , `pincode` INT(11) UNSIGNED NOT NULL COMMENT 'User''s Address Pincode' , `email` VARCHAR(255) NOT NULL COMMENT 'User''s Contact Email' , `mobile` INT(11) UNSIGNED NULL COMMENT 'User''s Contact Mobile' , `phone` INT(11) UNSIGNED NULL COMMENT 'User''s Contact Phone' , `sex` ENUM('M','F','NS') NOT NULL COMMENT 'User''s Sex' , `dateOfBirth` DATE NOT NULL COMMENT 'User''s Date of Birth' , `designation` VARCHAR(255) NULL COMMENT 'User''s Designation' , `dateOfEntry` TIMESTAMP on update CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'User''s Date of Entry' , PRIMARY KEY (`BBZUID`(9)) , UNIQUE (`username`(30)) ) ENGINE = InnoDB COMMENT = 'User''s Database';
You have to remove the length of the key:
PRIMARY KEY (`BBZUID`) ,
instead of
PRIMARY KEY (`BBZUID`(9)) ,
SQL code
instead of primary key('id'(10));
it would be primary key('id');
change this part of SQL syntax:
PRIMARY KEY (BBZUID
(9)) -> PRIMARY KEY (BBZUID
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With