0

I know the general advice is never to use utf8, but instead to use utf8mb4. If that's the advice, then why do the system tables themselves use utf8?

You can see this in the MariaDB test suite, and and the MySQL test suite; or, by using SHOW CREATE TABLE mysql.db;

1

By Definitions as per MySQL Reference Manual:

utf8mb4: A UTF-8 encoding of the Unicode character set using one to four bytes per character.

utf8mb3 : A UTF-8 encoding of the Unicode character set using one to three bytes per character.

Since, utf8mb3 (also known as UTF8) can not store all languages like Chinese or Emoticons, it is recommended to use utf8mb4 when it comes to store application data.

For simple example, You want to extend your existing business into China. if you have used utf8mb4, your application is always ready to adopt your business extension while in case of utf8mb3(UTF-8), you need an character set upgrade to your application.

While storing system's data MySQL does not store information (supplementary character) which requires utf8mb4, this could be the reason, why MySQL itself is not using utf8mb4.

2
  • 1
    So what if I want to create a table with a chinese name? – I Support The Boycott Jun 21 '19 at 14:21
  • 1
    Few Chinese character does require utf8mb4 while few does not requires. For those which requires it, you can't create table with that name. For example 𡞰 requires utf8mb4 hence you can not create a table with this name and will get error "ERROR 1300 (HY000): Invalid utf8 character string: '\xF0\xA1\x9E\xB0'" But you can create table with 测试 name and it actually does not require utf8mb4. Hope this clarifies – thisissanjeeva.com Jun 27 '19 at 7:49
-1

Pretty much every column in that table is a Y/N field, using the ENUM datatype. Since it has such a consistent and simple dataset there was no reason to use a more complex collation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.