容器需要先需要下载vim
apt-get update
apt-get install vim
进入目录
cd /etc/mysql
vim my.cnf
修改这个配置文件
添加
[mysqld]
default-character-set = utf8
character_set_server = utf8
[mysql]
default-character-set = utf8
[mysql.server]
default-character-set = utf8
[mysqld_safe]
default-character-set = utf8
[client]
default-character-set = utf8