skip to Main Content

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.

2

Answers


  1. 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.

    Login or Signup to reply.
  2. Is Звіти supposed to be saying Звіти ? If so, it looks like you got ‘Mojibake’ involving cp1251 instead of utf8.

    See Trouble with UTF-8 characters; what I see is not what I stored . In particular see the tip on fetching SELECT HEX(col) ... — This may help discover further whether the data was stored incorrectly or being fetched incorrectly. Or maybe something worse, like ‘double-encoding’.

    The other string may be Зелена карта?

    (MyISAM versus InnoDB is not relevent in character set encoding problems.)

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search