MySQL Forums
Forum List  »  Newbie

Error Message - specified key was too long max key length is 767 bytes
Posted by: Mike Lambert
Date: June 08, 2021 07:47AM

Hi,

I get the error message "Error Message - specified key was too long max key length is 767 bytes" when creating an indexed table. I have looked up the error and there are a lot of references to it which I don't understand. The key length is 258 bytes .
CREATE TABLE `nplayerseasonteam`(
`nplayerseasonteamkey1` VARCHAR(258) NOT NULL ,
`nplayerseasonteamteam` VARCHAR(80) NOT NULL ,
`nplayerseasonteamsur` VARCHAR(40) NOT NULL ,
`nplayerseasonteamfir` VARCHAR(40) NOT NULL ,
`nplayerseasonteamposn1` CHAR(2) NOT NULL ,
`nplayerseasonteamsur2` VARCHAR(40) NOT NULL ,
`nplayerseasonteamfir2` VARCHAR(40) NOT NULL ,
`nplayerseasonteamposn2` CHAR(2) NOT NULL ,
`nplayerseasonteamseason` CHAR(6) NOT NULL ,
`nplayerseasonteamdate` CHAR(8) NOT NULL ,
`nplayerseasonteamtotal` INT UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`nplayerseasonteamkey1`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

I don't know how to get past this. I have created this table before with no issues but this time I had to rebuild my PC and start all as new and this is the result.
Thks,
Mike

Options: ReplyQuote


Subject
Written By
Posted
Error Message - specified key was too long max key length is 767 bytes
June 08, 2021 07:47AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.