Database utf8mb4 collation
Anyone who has had their database switched from utf8mb4 utf8mb4_unicode_ci to something else, or on backup incorrect collation on restore, has found themselves with things not working properly.
This simple php script will fix your problems, and I wrote it real quick when I had a database issue.
It must go in your site root. Then access it by
https://mysite/convert_mysql.php
It will take a minute, then be done. So much easier than any other method you may have googled 😁
Remove the script when done.
Enjoy!
Note: you may need to rename the downloaded php file from the abcdefghijkl.php to convert_mysql.php (due to UNA S3 storage).
-
-
- · Chris Andre Buys
- ·
We now in 2025 April.....Will this still work on RC5, @LeonidS as much as this makes sense to me... please what is your intake to it.
-
Hello @Chris Andre Buys !
It's better to ask those users who were using this script. About how it was successful before 14RC5
-
The only reason why I want to change it is for the reaction wildcards... but I hear you... Thanks
-
I've struggled like hell, but it's sorted and working 100%.... there are ways around the root access problem...
-
- · gkuhnert
- ·
@LeonidS - A respectful request: Could you add this to the audit page at some point in the future - and possibly even have a link to a "self heal" in case it ever gets broken
SELECT DEFAULT_CHARACTER_SET_NAME, DEFAULT_COLLATION_NAME FROM information_schema.SCHEMATA WHERE SCHEMA_NAME = DATABASE();
-
Hello @gkuhnert !
Well, this option may provide the wrong situation because the tables and fields may have different collations too.
-
- · gkuhnert
- ·
True. But at least it will identify the easily detectable issues. And if you wanted to - it would be possible to query the other schemas as well to detect table or field level differences. But in the real world, a restore from backup with wrong settings is going to represent a high rate of detection of problems, and the script provided by the original poster would seem to be a logical self heal solution if detected...