I'm currently using MySQL Workbench 8.0.21. If I press the wrench icon for the table editor window I always get the same (wrong) collation utf8mb4_0900_ai_ci. But this is not the real collation for the table!
I believe that this must be a bug with the Workbench, because I tried different things:
Setting the collation_connection for the client manually but without effect
SET NAMES utf8mb4 COLLATE utf8mb4_general_ci;
SET collation_connection = utf8mb4_general_ci;
Checking the table collation
SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_COLLATION FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'parts';
which correctly prints utf8mb8_general_ciTried to edit mysql.cnf
but again without effect:
[client]
default-character-set=utf8mb4
[mysql]
default-character-set=utf8mb4
[mysqld]
collation-server=utf8mb4_general_ci
#init-connect='SET NAMES utf8mb4 COLLATE utf8mb4_general_ci;'
init-connect='SET collation_connection = utf8mb4_general_ci;'
character-set-server=utf8mb4
There seems to be no solution for changing the default character set/collation when connecting with MySQL Workbench.
The setting default_collation_for_utf8mb4 seems to be only valid for replication purposes. Would be turning off character-set-client-handshake an alternative solution for my problem?
Have you also experienced this weird behavior in the Workbench?