[solved] MySQL is used as database but does not support 4-byte characters error message persist after fix

Ubuntu 18.04.2 LTS
Nextcloud 16.0.0
MariaDB 10.1.38-MariaDB
PHP 7.2

I am fairly new to Linux, so please forgive any dumb questions and showing me the exact commands to use is very helpful. I am using linux to force myself to learn it. I’m also documenting the entire setup process for myself, if I ever need to build from scratch in the future.

I followed this document
https://docs.nextcloud.com/server/16/admin_manual/configuration_database/mysql_4byte_support.html#mariadb-10-2-or-earlier

And am still receiving the following error message.

MySQL is used as database but does not support 4-byte characters. To be able to handle 4-byte characters (like emojis) without issues in filenames or comments for example it is recommended to enable the 4-byte support in MySQL. For further details read the documentation page about this.

My steps:

sudo nano /etc/mysql/my.cnf

Added the following lines at the end

[mysqld]
innodb_large_prefix=true
innodb_file_format=barracuda
innodb_file_per_table=1

Restarted MariaDB

sudo systemctl restart mariadb

Logged into mariadb

sudo mysql –h localhost –u root -p

The format the first time was Antelope by using

SELECT NAME, SPACE, FILE_FORMAT FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME like "nextcloud%";

Created the mass list of commands by using

USE INFORMATION_SCHEMA;
SELECT CONCAT(“ALTER TABLE ‘”, TABLE_SCHEMA,”’.’”, TABLE_NAME, “’ ROW_FORMAT=DYNAMIC;”) AS MySQLCMD FROM TABLES WHERE TABLE_SCHEMA = “nextclouddb”;

Removed all the |'s and pasted back in.

Verified all tables were now barracuda.

Restarted MariaDB

sudo systemctl restart mariadb

Even restarted the server and the error message still appears. Thanks for any and all help.

Did you also Continue with steps 3 to 5 of the mysql section?

  1. Change your databases character set and collation:
ALTER DATABASE nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
  1. Set the mysql.utf8mb4 config to true in your config.php:
sudo -u www-data php occ config:system:set mysql.utf8mb4 --type boolean --value="true"
  1. Convert all existing tables to the new collation by running the repair step:
sudo -u www-data php occ maintenance:repair
1 Like

I did not as I was following 10.2 or earlier section only. I ran into other issues with the server, but I will try that as soon as I can and let you know the outcome.

Bernie_O

Thanks, what you stated fixed the issue.

[solved]
Same issue with : Debian stretch - Nextcloud 15.0.7 - MariaDB 10.1.38 - PHP 7.2

An hour I’ve been trying and it was enough to continue to step 3 …
Thanks Bernie_O

I opened a pull request to make this clearer in the documentation: