I've been following this tutorial on how to setup a MySQL server/database for unicode, with the hopes of setting up the default character set to utf8mb4
, and the collation to utf8mb4_unicode_ci
Just like what is specified in the tutorial, I have the following settings applied in my .ini file, located at C:\ProgramData\MySQL\MySQL Server 5.7 :
[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
When running this query in MySql Workbench:
SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%'
It has not been showing the system variables that I would expect, so initially I thought I had misconfigured the server:
MySql Workbench output
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
However, when using the native MySQL command line client, I'm seeing what I would expect:
+--------------------------+--------------------+
| 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 |
+--------------------------+--------------------+
Why would MySql Workbench not respect the configuration settings, like the command line client does?
MySql: Windows/5.7.21
MySql Workbench: Windows/6.3.10