Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: TiDB6.0 如何在创建集群时使用默认排序规则为utf8mb4_general_ci
[Test Environment for TiDB] Production environment in testing
[Problem Encountered:] As a beginner, I feel a bit confused after reading the documentation. How can I set the default collation to utf8mb4_general_ci when creating a cluster? How can I change the collation of an already created cluster from utf8mb4_bin to utf8mb4_general_ci?
Thanks for the help. The collation documentation is a bit challenging for me to understand
(MySQL beginner)
If the new framework’s support for characters is enabled, it can be directly supported without specific settings. However, this parameter needs to be set during cluster initialization…
Reference documentation:
Details:
You can show that the supported collations already include utf8mb4_general_ci, which means the new_collations_enabled_on_first_bootstrap parameter was set to true when initializing the cluster. So you can directly modify the parameters as follows:
SET GLOBAL collation_connection=‘utf8mb4_general_ci’;
SET GLOBAL collation_database=‘utf8mb4_general_ci’;
SET GLOBAL collation_server=‘utf8mb4_general_ci’;
This makes everything clear!
Thank you for the explanation.
If you set it this way in the command line, will it become invalid after restarting the cluster, or will it remain effective permanently?
Long-lasting, set global changes system variables, not configuration file parameters.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.