Cannot use utf8mb4 in MySQL 5.6
Steps to reproduce
- Prepare a MySQL 5.6 with utf8mb4 collation
- Make sure the proper my.ini has the following configuration:
- Make sure the database is set to utf8mb4_general_ci
- Prepare a clean de-10 bundle to connect to that db
- Set the following jdbc to avoid force-using utf8
- Start the bundle
MySQLSyntaxErrorException: Specified key was too long; max key length is 767 bytes error is thrown and liferay schema is not initialized.
See attached log for full stacktrace.
Liferay schema is initialized successfully and Liferay starts properly
de-10 + MySQL 5.6.26
Could not reproduce in
de-10 + MySQL 5.7.12
It could be possible that the issue to be related to innodb_default_row_format parameter.
MySQL 5.6 does not have such parameter, but in 5.7 it does and it is set to DYNAMIC by default in 5.7. Looks like in 5.6 it is forced to COMPACT.
innodb_large_prefix might also be related. Setting it to innodb_large_prefix=1, innodb_large_prefix=ON or innodb_large_prefix=true did not help.
MySQL 5.6 is a supported database so it should work as well
- Is this a Liferay bug or misconfiguration?
- What configuration is needed to make Liferay work in a utf8mb4 database (in 5.6)?