# 创建mysql数据库

docker-compose 创建数据库\
`docker-compose -f db.yml up -d`

```
db:
  container_name: mysql
  image: mysql:5.7.17
  command: --default-authentication-plugin=mysql_native_password --character-set-server=utf8 --collation-server=utf8_unicode_ci
  restart: always
  environment:
    MYSQL_ROOT_PASSWORD: 123456
  ports:
   - '3307:3306'
  volumes:
   - '/data/docker/volume/mysql/data:/var/lib/mysql'
   - '/data/docker/volume/mysql/logs:/logs'
   - '/data/docker/volume/mysql/conf:/etc/mysql/conf.d'
```
