Skip to content

Instantly share code, notes, and snippets.

View iagopiimenta's full-sized avatar
🏠
Working from home

Iago Pimenta iagopiimenta

🏠
Working from home
View GitHub Profile

Mysql2::Error: Specified key was too long; max key length is 767 bytes

You might get this error with InnoDB tables on MariaDB < 10.2.2, MySQL < 5.7. Although, this error might be also triggered on newer versions if you switch to COMPACT row format.

In the abovementioned releases the default InnoDB row format is COMPACT. With this format the maximum index prefix length is [767 bytes][max-index-prefix]. The default character set is [latin1][def-charset], but if you use