Search code examples
mysqlamazon-rdsinnodb

What does schema 'mysql' mean in 'mysql - schema's default character set: utf8'? Is it innodb?


While upgrading mysql from 5.6 -> 5.7 -> 8.0.23 in step 5.7 -> 8.0.23 I got a warning:

The following objects use the utf8mb3 character set. It is recommended to convert them to use utf8mb4 instead, for improved Unicode support.
More Information:
https://dev.mysql.com/doc/refman/8.0/en/charset-unicode-utf8mb3.html

common_schema - schema's default character set: utf8
mysql - schema's default character set: utf8
common_schema._global_qs_functions.function_arguments - column's default character set: utf8
common_schema._global_qs_variables.value_snapshot - column's default character set: utf8
common_schema._global_script_report_data.info - column's default character set: utf8
...

What does schema 'mysql' mean in 'mysql - schema's default character set: utf8'? Is it innodb?


Solution

  • Every MySQL instance has a system schema named mysql that contains tables for system information, like user passwords and privileges, timezones, stored routines, and so on. You can read about it in the manual: https://dev.mysql.com/doc/refman/5.7/en/system-schema.html

    What this warning is telling you is that the system schema is defined with a default character set that is not recommended. You can see the default character set this way:

    mysql> show create schema mysql;
    +----------+-------------------------------------------------------------------+
    | Database | Create Database                                                   |
    +----------+-------------------------------------------------------------------+
    | mysql    | CREATE DATABASE `mysql` /*!40100 DEFAULT CHARACTER SET utf8mb4 */ |
    +----------+-------------------------------------------------------------------+
    

    In my case, the default character set of the system schema is utf8mb4.

    A schema's default character set has no effect unless you create a new table and do not specify its character set. The default character set of the schema will be used for that table.

    (In MySQL, "schema" and "database" are synonyms in most contexts.)