本文主要是介绍docker-compose.yml mysql,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
这里写目录标题
- 1. docker-compose.yml mysql
- 1.1. tree
- 1.2. docker-compose.yml
- 1.3. restart5.sh
1. docker-compose.yml mysql
1.1. tree
|-- bak
| `-- mysql
| |-- conf.d
| | |-- docker.cnf
| | |-- mysql.cnf
| | `-- mysqldump.cnf
| |-- my.cnf -> /etc/alternatives/my.cnf
| |-- my.cnf.fallback
| |-- mysql.cnf
| `-- mysql.conf.d
| `-- mysqld.cnf
|-- conf
| |-- conf.d
| | |-- docker.cnf
| | |-- mysql.cnf
| | `-- mysqldump.cnf
| |-- my.cnf
| |-- my.cnf.fallback
| |-- mysql.cnf
| `-- mysql.conf.d
| `-- mysqld.cnf
|-- docker-compose.yml
`-- restart5.sh
1.2. docker-compose.yml
version: '2'
services:
mysql:
container_name: "mysql5"
network_mode: "bridge"
environment:
MYSQL_ROOT_PASSWORD: "1234@"
image: "mysql:5"
command: --default-authentication-plugin=mysql_native_password
# restart: always
volumes:
- "/root/db5:/var/lib/mysql"
- "/mnt/hgfs/share/docker-composes/mysql5/conf:/etc/mysql"
- "/mnt/hgfs/share/docker-composes/mysql5/conf/my.cnf:/etc/my.cnf"
ports:
- "3306:3306"
- "33060:33060"
1.3. restart5.sh
#/bin/sh
docker stop mysql5
docker rm mysql5
docker-compose up -d
docker ps -a
这篇关于docker-compose.yml mysql的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!