gpt4 book ai didi

mysql - 在AWS RDS上将MySQL服务器变量collat​​ion_connection设置为utf8_unicode_ci

转载 作者:行者123 更新时间:2023-12-03 17:20:27 24 4
gpt4 key购买 nike

所以我的目标是将所有字符集和排序规则设置为utf8utf8_unicode_ci

我正在使用AWS RDS托管MySQL服务器。

我已经在RDS的“参数”组中将collation_connection variable设置为utf8_unicode_ci
This is how I set the variable in the parameter group


Ive然后重新启动了我的RDS,当进入MySQL控制台时,它会显示以下变量值。

mysql> show variables like "%character%";show variables like "%collation%";
+--------------------------+-------------------------------------------+
| Variable_name | Value |
+--------------------------+-------------------------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /rdsdbbin/mysql-5.6.22.R1/share/charsets/ |
+--------------------------+-------------------------------------------+
8 rows in set (0.01 sec)

+----------------------+-----------------+
| Variable_name | Value |
+----------------------+-----------------+
| collation_connection | utf8_general_ci |
| collation_database | utf8_unicode_ci |
| collation_server | utf8_unicode_ci |
+----------------------+-----------------+

我不确定为什么将 collation_connection设置为 utf8_general_ci

最佳答案

您在此处看到的变量是当前客户端 session 的变量:

+----------------------+-----------------+
| Variable_name | Value |
+----------------------+-----------------+
| collation_connection | utf8_general_ci |
| collation_database | utf8_unicode_ci |
| collation_server | utf8_unicode_ci |
+----------------------+-----------------+

因此,在启动连接时,需要在要连接的客户端上运行以下命令:
SET collation_connection = 'utf8_unicode_ci';

关于mysql - 在AWS RDS上将MySQL服务器变量collat​​ion_connection设置为utf8_unicode_ci,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35931530/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com