docker-mysql

一、新建容器实例
docker run -d -p 3306:3306 --privileged=true
-v /finnlee/mysql/log:/var/log/mysql
-v /finnlee/mysql/data:/var/lib/mysql
-v /finnlee/mysql/conf:/etc/mysql/conf.d
-e MYSQL_ROOT_PASSWORD=123456
--name mysql mysql:8.0

二、新建my.cnf 设置字符编码
[client]
default_character_set=utf8
[mysqld]
collation_server = utf8_general_ci
character_set_server = utf8

三、重新启动服务