Want to subscribe to topics you're interested in?
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.

Tags:
  1. jeffwidman

    jeffwidman Active Member

    152
    27
    28
    Dec 3, 2014
    Ratings:
    +51
    Local Time:
    1:40 PM
    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
    • Informative Informative x 1
  2. eva2000

    eva2000 Administrator Staff Member

    30,902
    6,908
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,404
    Local Time:
    7:40 AM
    Nginx 1.13.x
    MariaDB 5.5
    Last edited: Jun 12, 2015
    • Like Like x 1