I have enabled utf8mb4 in MariaDB, I had to manually fix some table due to fields too wide to be indexed. It seems to work well but I got problems with nextcloud and app upgrade.
The plugins attempt to create tables with index on varchar(255) field and it give this error:
An exception occurred while executing ‘CREATE TABLE oc_group_folders_trash (trash_id BIGINT AUTO_INCREMENT NOT NULL, name VARCHAR(250) NOT NULL, original_location VARCHAR(4000) NOT NULL, deleted_time BIGINT NOT NULL, folder_id BIGINT NOT NULL, INDEX groups_folder_trash_folder (folder_id), INDEX groups_folder_name (folder_id, name), UNIQUE INDEX groups_folder_trash_unique (folder_id, name, deleted_time), PRIMARY KEY(trash_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin ENGINE = InnoDB ROW_FORMAT = compressed’: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
So I must shorten the 255 to 190 in source code before installing.
Am I wrong to fix things this way ? Is there a general parameter that force nextcloud to limit indices to 190 char ?
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
This is most likely due to the database not being setup correctly for Nextcloud. Please check the following documentation of Nextcloud to setup the database server correctly.
I had the same issue with it reverting back after a server restart, so I executed the statements again but after another restart it reverted back again, so I got fed up with it and just added this to the mentioned config file.
The problem with this is though, that you need to have access to that config, to make these changes. People who don’t have access to the config, might have to ask their hoster.
If my solution helped you, it would be awesome, of you could mark it as solution.