Bug #113016 sys database can't select when use utf8mb4_general_ci
Submitted: 9 Nov 2023 6:22 Modified: 9 Nov 2023 11:49
Reporter: chong zhang Email Updates:
Status: Duplicate Impact on me:
Category:MySQL Server: SYS Schema Severity:S1 (Critical)
Version:8.0.25 OS:Any
Assigned to: CPU Architecture:Any

[9 Nov 2023 6:22] chong zhang
The database of sys cannot be queried anything on table because default_COLLATION_FOR_UTf8MB4 is set to UTF8MB4_general_ci.

How to repeat:
please put the Variable_name of default_collation_for_utf8mb4 to utf8mb4_general_ci and try to query anything on tables from database of sys.

Suggested fix:
please fix this bug or Disable parameter modification.

mysql sys database can't select data when use utf8mb4_general_ci,I found that changing the collation rules of sys can solve the problem.

Can I rebuild the collation rules of the sys database?  What would be the impact if I did this?

$ mysqldump  --user=root  --default-character-set=utf8    --password='xxx' --socket=/opt/mysql3303/mysql.sock  --single-transaction --hex-blob  --set-gtid-purged=off   --skip-tz-utc  --routines --triggers --events --add-drop-database --databases sys > sys_dump.sql

$ sed -i "s#utf8mb4_0900_ai_ci#utf8mb4_general_ci#g" sys_dump.sql

mysql> set session default_collation_for_utf8mb4=utf8mb4_0900_ai_ci;
mysql> source /xxx/sys_dump.sql
[9 Nov 2023 11:49] MySQL Verification Team
Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments to the original bug instead.

You have filed the same bug already:


Thank you for your interest in MySQL.