Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add innodb_large_prefix=1 to MySQL configuration #1

Merged
merged 2 commits into from
Mar 10, 2017

Conversation

mikl
Copy link
Contributor

@mikl mikl commented Mar 9, 2017

This is needed for Drupal 7 sites, because the actions table has a primary key on aid,
which is a varchar(255). When using the new utf8mb4 encoding. If large prefix is not
set, this causes an error:

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

(Due to 255*4 being 1020 bytes).

See also http://stackoverflow.com/a/36405914/66851

This is needed for Drupal 7 sites, because the actions table has a primary key on aid,
which is a varchar(255). When using the new utf8mb4 encoding. If large prefix is not
set, this causes an error:

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

(Due to 255*4 being 1020 bytes).

See also http://stackoverflow.com/a/36405914/66851
@lmakarov
Copy link
Member

lmakarov commented Mar 9, 2017

According to the comments in D7's default.settings.php there may be more settings necessary to enable utf8mb4 charset support for D7:

innodb_large_prefix=true
innodb_file_format=barracuda
innodb_file_per_table=true

MySQL docs on innodb_large_prefix also state that innodb_large_prefix=true and innodb_file_format=barracuda have to be set together to allow for large indexes. With MySQL 5.7.7 and up these are set by default and innodb_large_prefix is deprecated.

Further googling on innodb_file_format suggests that it was removed in MySQL 8.0.

Please update the PR according:

  • add innodb_file_format=barracuda for 5.5 and 5.6 (so all 3 settings mentions at the top are applied)
  • provide a comment on the settings alteration
  • remove alterations for 5.7 and 5.8 from the PR

Also, it is necessary to use a different file format for the larger column size, per the instructions in Drupal's default.settings.php.
@mikl
Copy link
Contributor Author

mikl commented Mar 9, 2017

Done, thanks for the feedback @lmakarov.

@lmakarov lmakarov merged commit 1e87ed2 into docksal:master Mar 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants