Saturday, 6 December 2014

mysql error: Specified key was too long; max key length is 767 bytes

There is no real solution for this issue. Your only options are to either reduce the size of the column, use a different character set (like UTF-8), or use a different engine (like MyISAM). In this case I switched the character set to UTF-8 which raised the maximum key length to 255 characters.

Ex.  create index IDX_Name on tableName (a(50), b(255), c(200));

It's means maximum key length will be 255 characters.

No comments:

Post a Comment