Search code examples
mysqlutf-8character-encodingmysql-workbenchutf8mb4

MySQL Workbench system variables discrepancy


MySQL Workbench: v8.0.13
MySQL: v5.7 (installed by brew on macOS 10.14.13)

Server variables tab, everything looks as expected, the options file (my.cnf) has the same settings. enter image description here

Actually this is how it behaves. eg. character_set_results switches back to utf8 instead of utf8mb4. enter image description here

Why are the two views different? What causes the difference?


Solution

  • https://dev.mysql.com/doc/workbench/en/wb-mysql-connections-new.html says:

    When opening connections, MySQL Workbench automatically sets the client character set to utf8.

    You can execute SET NAMES utf8mb4 after you open a connection in MySQL Workbench.

    This has been the subject of a bug report against MySQL Workbench:

    Bug #78503: MySQL WorkBench's Encoding is Hardcoded to UTF-8

    I suggest you go log into that page and click the "Affects Me" button to register your interest.