How to enable MySQL 4-byte support on a Strato hosted website
I have installed the most recent Nextcloud and I get the following message:
Please enable MySQL 4-byte support
Can anyone tell me how to do this on a Strato hosted website?
I don't know about Strato's servers but I do know I fell into the trap of converting the database to utf8mb4 / utf8mb4-general-ci and then being caught out by the update from Nextcloud 15.0.6 to 15.0.7 which kept hitting database errors. I had to edit the database several times to complete the update.
If you do wish to proceed with converting to utf8mb4 you can find Nextcloud's instructions here https://docs.nextcloud.com/server/stable/admin_manual/configuration_database/mysql_4byte_support.html
As a general guideline:
- Make the server changes as stated at the above link.
- Install the OCC Web addon
- Go to your new OCC Web page
- Run (by copy and paste then Enter)
config:system:set mysql.utf8mb4 --type boolean --value="true" - Run
maintenance:repair
That should be all you need to do...
If your database server is improperly (?) configured you will need to manually edit varchar(255) -- and those greater than 255 -- to set '255' to '191'. Not necessarily a good idea to do.
I added a question mark there because my database server is configured as shown in the Nextcloud help docs but I still hit errors.
When you run maintenance:repair you might (probably will) get the error message Specified key was too long; max key length is 767 bytes #2307. This message is accompanied with the table name that provoked the error. The table name is stated in the first red error message block. When this happens you can use PhpMyAdmin to view the specified table. Click to view the table structure. Where you see varchar(255) or varchar(number higher than 255) change the number to 191.
Each time you get that error the site will be placed into maintenance mode. This needs to be disabled or OCC Web will not work.
The maintenance mode flag is set in config.php. Use FTP, SSH or your hosts file browser in cPanel (best option) to edit the file /config/config.php and change 'maintenance' => true, to 'maintenance' => false, and save the file. Now you can run maintenance:repair again.. and fix the next table that will show up in another error message.
I'm new to Nextcloud. I like what I see so far. I'll be sticking with regular UTF8 for the time being.
The 2 servers I installed Nextcloud onto yesterday and today use MariaDB version 10.1.38-MariaDB-cll-lve and PHP 7.3.
As this seems to be a setup issue I would like to ask you to raise your question in the forums: https://help.nextcloud.com
If you wish support with setup issues from Nextcloud GmbH we offer this as part of the Nextcloud subscription. Learn more about this at https://nextcloud.com/enterprise/