0

One of my talbe has a multicolumn index with total 1011 characters. storage engine is InnoDB.

The same table was working just fine in mysql 5.6.26. but now when i upgraded to mysql 5.7.16 i get error Specified key was too long; max key length is 3072 bytes.

I know there's limist on total size of index. but the question is, why was it working in 5.6 and stopped working in 5.7. Is there some thing i can do without reducing the size of columns.

2
  • dba.stackexchange.com/questions/49913/… Commented Oct 16, 2016 at 18:19
  • okay, but why does the same thing used to work in 5.6 -- we have been using 5.6 since two years without any errors Commented Oct 16, 2016 at 18:25

1 Answer 1

3

The issue for us was the default character set. In old 5.6 version, my default character set was latin1, but when i installed 5.7.16 i did not change the character set and default was utf8, which resulted in larger column size, as utf takes more bytes, resulting in the error. changing the default character set back to latin1 and recreating table fixed the problem.

[mysqld] character-set-server=latin1 [client] default-character-set=latin1 [mysql] default-character-set=latin1 
Sign up to request clarification or add additional context in comments.

1 Comment

If this is the definitive solution to your problem, you should accept your own answer as the correct one.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.