docker部署mysql
mkdir -p /data/docker/mysql5.7/{data,conf.d}
mkdir -p /data/docker/mysql8/{data,conf.d}
version: '3'
services:
mysql_5.7:
image: mysql:5.7.40
restart: always
ports:
- 13306:3306
environment:
- MYSQL_ROOT_PASSWORD=password
volumes:
- /data/docker/mysql5.7/data:/var/lib/mysql
- /data/docker/mysql5.7/conf.d:/etc/mysql/conf.d
mysql_8.0:
image: mysql:8.0.31
restart: always
ports:
- 23306:3306
environment:
- MYSQL_ROOT_PASSWORD=password
volumes:
- /data/docker/mysql8/data:/var/lib/mysql
- /data/docker/mysql8/conf.d:/etc/mysql/conf.d
标签:部署,mysql5.7,mysql8,conf,mysql,docker,data
From: https://www.cnblogs.com/wszzn/p/18141081