浏览代码

utf8mb4

master
父节点
当前提交
86b9277a5e
共有 2 个文件被更改,包括 34 次插入0 次删除
  1. +2
    -0
      tasks/mysql.yml
  2. +32
    -0
      templates/config.php.j2

+ 2
- 0
tasks/mysql.yml 查看文件

@@ -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 查看文件

@@ -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


正在加载...
取消
保存