docker pull mysql:5.7
mkdir -p /docker/mysql/log # 日志文件
mkdir -p /docker/mysql/data # 数据文件
mkdir -p /docker/mysql/conf # 配置文件
vim /docker/mysql/conf/my.cnf # 新建配置文件
[client]
default_character_set=utf8
[mysqld]
collation_server = utf8_general_ci
character_set_server = utf8
docker run -d --name mysql -p 3306:3306 --privileged=true -v /docker/mysql/log:/var/log/mysql -v /docker/mysql/data:/var/lib/mysql -v /docker/mysql/conf:/etc/mysql/conf.d -e MYSQL_ROOT_PASSWORD=123456 mysql:5.7
原创文章,作者:kirin,如若转载,请注明出处:https://blog.ytso.com/275759.html