Enabling MySQL/MariaDB full Unicode support
To store the full range of Unicode characters in Nextcloud, including emoji, less-common writing systems, historic scripts, and specialized symbols, a MySQL or MariaDB database must use the utf8mb4 character set. The older three-byte utf8 character set cannot store characters outside Unicode's Basic Multilingual Plane.
Make sure the following InnoDB setting is enabled on your database server:
[mysqld] innodb_file_per_table=1
Restart the database server if you changed the configuration in step 1.
You can then verify that the change worked:
SHOW VARIABLES LIKE 'innodb_file_per_table';
The result should look like this:
mysql> SHOW VARIABLES LIKE 'innodb_file_per_table'; +-----------------------+-------+ | Variable_name | Value | +-----------------------+-------+ | innodb_file_per_table | ON | +-----------------------+-------+ 1 row in set (0.00 sec)
Open a shell, change to the Nextcloud installation directory (adjust /var/www/nextcloud as needed), and enable maintenance mode if it is not already enabled:
$ cd /var/www/nextcloud $ sudo -E -u www-data php occ maintenance:mode --on
Change the database character set to utf8mb4 and set its default collation:
ALTER DATABASE nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
Enable utf8mb4 support in the Nextcloud system configuration:
$ sudo -E -u www-data php occ config:system:set mysql.utf8mb4 --type boolean --value="true"
Run the repair command to convert the existing tables to the utf8mb4 character set and collation:
$ sudo -E -u www-data php occ maintenance:repair
Disable maintenance mode:
$ sudo -E -u www-data php occ maintenance:mode --off
Now you should be able to use Emojis in your file names, calendar events, comments and many more. Nextcloud can now use the full range of Unicode characters - such as emojis - in file names, calendar events, and comments.