Learn about Centmin Mod LEMP Stack today
Become a Member

MariaDB Default to 'innodb_large_prefix=1' in my.cnf templates? For better Wordpress compatibility

Discussion in 'MariaDB & General MySQL news & discussions' started by jeffwidman, Jun 12, 2015.

  1. jeffwidman

    jeffwidman Active Member

    Dec 3, 2014
    Local Time:
    2:02 AM
    Wordpress recently switched from utf8 to utf8mb4/utf8mb4_unicode_ci as the character set and collation for their tables.

    This means indexes are limited to a smaller size. As a partial workaround, MySQL/MariaDB supports setting 'innodb_large_prefix=1' which allows for larger index sizes when certain conditions are met. When those conditions are not met, it doesn't have any effect, which should make it safe to enable.

    Can this be added to the my.cnf templates in Centminmod? I think it should be on by default because Wordpress will be one of the most popular apps installed on Centminmod servers. Wordpress will auto-set the character set and collation for its tables, but as far as I can tell, it can't change this setting--it needs to be set by the DBA in /etc/my.cnf (or similar).

    You can see it mentioned here as a useful setting by one of the core Wordpress devs: WordPress and UTF-8 | Gary Pendergast.

    May also wish to add a note to centminmod.com/mysql that folks using Wordpress may want to set default character set and collation to utf8mb4/utf8mb4_unicode_ci instead of defaulting to utf-8.

    Unfortunately, looks like Xenforo doesn't support utf8mb4 without hacking core--the input function is only partially extendable. Hopefully this lands in Xenforo 2.0, especially if you vote for it by liking the first post in this suggestion thread.

    Thankfully, as far as I can tell, Xenforo and Wordpress are both very explicit about setting their character set/collation at the table/column level when they install themselves, so even if the server default is different it shouldn't affect them.
    Last edited: Jun 12, 2015
  2. eva2000

    eva2000 Administrator Staff Member

    May 24, 2014
    Brisbane, Australia
    Local Time:
    7:02 PM
    Nginx 1.25.x
    MariaDB 10.x
    Last edited: Jun 12, 2015