Discover Centmin Mod today
Register Now

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.

Tags:
  1. jeffwidman

    jeffwidman Active Member

    152
    27
    28
    Dec 3, 2014
    Ratings:
    +51
    Local Time:
    10:24 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

    55,239
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,833
    Local Time:
    3:24 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Last edited: Jun 12, 2015