Search code examples
mysqlencodingmysql-workbench

Encoding issue with MySQL Workbench


I have database in UTF-8 (utf8_general_ci) enconding in phpMyAdmin. I export it as CSV file to another computer where MySQL Workbench is installed. The encoding problem is only with cyrillic characters when I import it to the MySQL Workbench. It displays as garbage:

Звіти
Зелена карта

I have checked the schema encoding in MySQL Workbench:

Default collation: utf8mb3_general_ci

Default characterset: utf8mb3

When I try to alter the schema and set UTF-8/utf8_general_ci in the MySQL Workbench it reports as:

Apply changes to pess   Changes applied 

But this schema is still in utf8mb3_general_ci/utf8mb3. The question is how can I change the encoding to UTF-8/utf8_general_ci in MySQL Workbench? Thanks.


Solution

  • You should use utf8mb4 in the current version of MySQL 5.7 or 8.0.

    https://dev.mysql.com/doc/refman/8.0/en/charset-unicode-utf8mb3.html

    Note

    Historically, MySQL has used utf8 as an alias for utf8mb3; beginning with MySQL 8.0.28, utf8mb3 is used exclusively in the output of SHOW statements and in Information Schema tables when this character set is meant.

    At some point in the future utf8 is expected to become a reference to utf8mb4. To avoid ambiguity about the meaning of utf8, consider specifying utf8mb4 explicitly for character set references instead of utf8.

    You should also be aware that the utf8mb3 character set is deprecated and you should expect it to be removed in a future MySQL release. Please use utf8mb4 instead.