Page 1 of 1

Default database collation should be utf8_unicode_ci

Posted: Thu 26. Oct 2023, 11:19
by shoulders
The default collation for tables in phpMyAdmin is utf8mb4_general_ci but should be utf8mb4_unicode_ci. This setting might be server thing or a phpMyAdmin setting. I cannot remember it has been a while.
db collation.png
db collation.png (9.86 KiB) Viewed 5517 times
The 'Server connection collation' is already utf8mb4_unicode_ci
server connection.png
server connection.png (15.95 KiB) Viewed 5517 times
utf8mb4_unicode_ci is a much more efficient search algorithm and the extra overheads are minimal. This is also the standard collation that WordPress now uses for its tables where it can.

I can probably figure out how to change this myself, but for new installs this should be set tot he new collation of utf8mb4_unicode_ci

shoulders

Re: Default database collation should be utf8_unicode_ci

Posted: Thu 26. Oct 2023, 11:47
by Florian
Hello,

it is the default setting of MariaDB. Keyhelp does not change anything here.

Re: Default database collation should be utf8_unicode_ci

Posted: Thu 26. Oct 2023, 11:59
by shoulders
Then maybe KeyHelp could change this setting with a modification to a script. This is a really poor collation to be using.

For reference:

Re: Default database collation should be utf8_unicode_ci

Posted: Thu 26. Oct 2023, 12:03
by 24unix
shoulders wrote: Thu 26. Oct 2023, 11:59 Then maybe KeyHelp could change this setting with a modification to a script. This is a really poor collation to be using.
Then the DBA should use what he likes better, you can change it anytime. The defaults are not really important.

Re: Default database collation should be utf8_unicode_ci

Posted: Thu 26. Oct 2023, 12:14
by Alexander
shoulders wrote: Thu 26. Oct 2023, 11:59 Then maybe KeyHelp could change this setting with a modification to a script. This is a really poor collation to be using.
You may want to ask the operating system vendors, why they set the default to utf8mb4_general_ci instead of utf8mb4_unicode_ci.

I had a look:
- Ubuntu 22 uses utf8mb4_general_ci
- Debian 12 uses utf8mb4_general_ci