MySQL utf8mb4 on Amazon RDS: global variables set correctly but variables not set

I am trying to convert my Amazon RDS server to use encoding utf8mb4instead utf8. I followed the manual here and it worked for the most part (global variables are set through my new parameter group in RDS), but my system variables are set incorrectly, which means that I am not able to use the new encoding.

When I run:

SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%';

I see:

+--------------------------+--------------------+
| Variable_name            | Value              |
+--------------------------+--------------------+
| character_set_client     | utf8               |
| character_set_connection | utf8               |
| character_set_database   | utf8mb4            |
| character_set_filesystem | binary             |
| character_set_results    | utf8               |
| character_set_server     | utf8mb4            |
| character_set_system     | utf8               |
| collation_connection     | utf8_general_ci    |
| collation_database       | utf8mb4_unicode_ci |
| collation_server         | utf8mb4_unicode_ci |
+--------------------------+--------------------+

Which is clearly wrong, but when I run:

SHOW GLOBAL VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%';

I see:

+--------------------------+--------------------+
| Variable_name            | Value              |
+--------------------------+--------------------+
| character_set_client     | utf8mb4            |
| character_set_connection | utf8mb4            |
| character_set_database   | utf8mb4            |
| character_set_filesystem | binary             |
| character_set_results    | utf8mb4            |
| character_set_server     | utf8mb4            |
| character_set_system     | utf8               |
| collation_connection     | utf8mb4_unicode_ci |
| collation_database       | utf8mb4_unicode_ci |
| collation_server         | utf8mb4_unicode_ci |
+--------------------------+--------------------+

This is correct, but for some reason, these global values ​​do not install the server when the server restarts. I can correctly set the variables manually after restarting, but I do not understand why they are not set initially.

+6
3

. MySQL, . , , .

+1

, ( ) / ; . - db - SQLyog, MySQL Workbench, - , . , / utf8mb4 utf8mb4_unicode_ci,

SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%';

. "" , , _client, _connection .., , mysql, .

+1

For me, this was because I skipped the instructions (in the original related manual) to modify /etc/my.cnf:

[client]
default-character-set = utf8mb4

[mysql]
default-character-set = utf8mb4

[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
0
source

Source: https://habr.com/ru/post/1621745/


All Articles