Index Key Prefix Length Limitation on InnoDB

Index Key Prefix Length Limitation on InnoDB

I encountered the problem index key prefix length limitation on InnoDB when I migrate a database. The problem was like this:

Specified key was too long; max key length is 767 bytes

The index key prefix length limit is 767 bytes if you use the version of MySQL either 5.5 or 5.6. Or you use 5.7 the default is 3076 bytes.

innodb_large_prefix is deprecated and will be removed in a future release. Therefore, We need to consider whether we should enable innodb_large_prefix.

And Index key prefixes larger than 767 bytes are silently truncated if you change innodb_large_prefix to OFF from ON.