从dockerhub上pull mariadb镜像
docker pull mariadb
启动mariadb
docker run --name mysql1 -e MYSQL_ROOT_PASSWORD=root -d mariadb
进入mariadb
docker exec -it mysql1 /bin/bash
修改mariadb的配置文件
文件所在目录:/etc/mysql/conf.d/mariadb.cnf
修改内容:
[client]
# Default is Latin1, if you need UTF-8 set this (also in server section)
default-character-set = utf8
[mysqld]
# Default is Latin1, if you need UTF-8 set all this (also in client section)
character-set-server = utf8
提交mysql容器,生成新的镜像,保存修改
docker commit mysql1 mariadb:v1
原文地址:http://12096733.blog.51cto.com/12086733/1954682