When I run a program which does something with MySQL, I got this error message:
2015-06-10 15:41:12,250 ERROR app.wsutils 419 INCRON: Error: (\'HY000\
I had the same error despite having innodb_large_prefix
configured correctly.
The issue was in used collation. My db had default collation set to utf8mb4_bin
(you can check it in phpmyadmin "Operations" tab for database). It means it uses 4 bytes per char, while utf8 collation (e.g. utf8_unicode_ci) uses 3 bytes per char.
in this case you can either use different collation e.g. by adding DEFAULT CHARSET=utf8
at the end of the CREATE TABLE
statement, or limit the index size by using just a part of the column value
like KEY 'identifier' (column1(5),column2(10))
.
See also related question: #1071 - Specified key was too long; max key length is 767 bytes