I'm running a MySQL docker container (latest - 8.0) with the custom configuration file containing:
======================================
[client]
default-character-set=utf8mb4
[mysqld]
collation_server = utf8mb4_unicode_ci
init-connect='SET NAMES utf8mb4'
character_set_server = utf8mb4
[mysql]
default-character-set=utf8mb4
======================================
Executing inside MySQL console:
show variables like "%coll%";
produces this:
+-------------------------------+--------------------+
| Variable_name | Value |
+-------------------------------+--------------------+
| collation_connection | utf8mb4_0900_ai_ci |
| collation_database | utf8mb4_unicode_ci |
| collation_server | utf8mb4_unicode_ci |
| default_collation_for_utf8mb4 | utf8mb4_0900_ai_ci |
+-------------------------------+--------------------+
Executing inside MySQL console:
show variables like "%char%";
produces this:
+--------------------------+--------------------------------+
| Variable_name | Value |
+--------------------------+--------------------------------+
| character_set_client | utf8mb4 |
| character_set_connection | utf8mb4 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | utf8mb4 |
| character_set_server | utf8mb4 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql-8.0/charsets/ |
+--------------------------+--------------------------------+
BUT when I go the MySQL console with:
docker exec -it mysql1 mysql -uroot -p*********
I can't use cyrillic (russian) characters. When I switch to Russian locale and try to type anything, the console just ignores keypresses, nothing is displayed on the screen. But when I switch to English locale, everything starts working again.
What can I do to solve this problem?
PS: I AM able to interact with the database via DataGrip and enter Russian characters for table names, fields and records. I'm just completely unable to use Russian characters when I'm inside the MySQL console inside the docker container.
PPS: MySQL is running from an official Docker image on MacOS Mojave and I'm using iTerm 3.2.6. Character encoding in iTerm is set to "Unicode (UTF-8)"
init-connect
is ignored byroot
, but that won't explain the problem. Were thoseSHOWs
done via docker's MySQL console?docker exec -it mysql1 mysql
and then execute theshow
commands.