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