Answer the question
In order to leave comments, you need to log in
How to get rid of an encoding error when creating a container?
The situation is the following. Through docker-compose, I create a container based on the official image of the latest version of MySQL with the command command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci.
But I connect to the database through Workbench and see that the database has the correct utf8mb4 encoding set, but the default comparison is utf8mb4_unicode_ci instead of the expected utf8mb4_unicode_ci, and the mysql> show charset command, among other encodings, displays the string utf8mb4 | UTF-8 Unicode | utf8mb4_unicode_ci | 4.
How to force containers to run in the required encoding and comparison?
Answer the question
In order to leave comments, you need to log in
Try adding mysql file to config like this:
[mysqld]
init_connect='SET collation_connection = utf8mb4_unicode_ci'
collation-server=utf8mb4_unicode_ci
-v /local/path/to/hosts/config/collation.conf:/etc/my.cnf.d/collation.conf
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question