Browse Source

utf8mb4

master
parent
commit
86b9277a5e
2 changed files with 34 additions and 0 deletions
  1. +2
    -0
      tasks/mysql.yml
  2. +32
    -0
      templates/config.php.j2

+ 2
- 0
tasks/mysql.yml View File

@@ -11,5 +11,7 @@
- name: mysql database
mysql_db:
name: "{{nextcloud_database_name}}"
encoding: utf8mb4
collation: utf8mb4_unicode_ci
state: present
delegate_to: "{{ nextcloud_database_host }}"

+ 32
- 0
templates/config.php.j2 View File

@@ -108,6 +108,38 @@ $CONFIG = array(
*/
'installed' => false,

/**
* During setup, if requirements are met (see below), this setting is set to true
* and MySQL can handle 4 byte characters instead of 3 byte characters.
*
* If you want to convert an existing 3-byte setup into a 4-byte setup please
* set the parameters in MySQL as mentioned below and run the migration command:
* ./occ db:convert-mysql-charset
* The config setting will be set automatically after a successful run.
*
* Consult the documentation for more details.
*
* MySQL requires a special setup for longer indexes (> 767 bytes) which are
* needed:
*
* [mysqld]
* innodb_large_prefix=ON
* innodb_file_format=Barracuda
* innodb_file_per_table=ON
*
* Tables will be created with
* * character set: utf8mb4
* * collation: utf8mb4_bin
* * row_format: compressed
*
* See:
* https://dev.mysql.com/doc/refman/5.7/en/charset-unicode-utf8mb4.html
* https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_large_prefix
* https://mariadb.com/kb/en/mariadb/xtradbinnodb-server-system-variables/#innodb_large_prefix
* http://www.tocker.ca/2013/10/31/benchmarking-innodb-page-compression-performance.html
* http://mechanics.flite.com/blog/2014/07/29/using-innodb-large-prefix-to-avoid-error-1071/
*/
'mysql.utf8mb4' => true,

/**
* User Experience


Loading…
Cancel
Save