version: '3'
services:
  db:
    image: "mysql:5.7.19"
    ports:
      - "127.0.0.1:3306:3306"
    environment:
      MYSQL_ROOT_PASSWORD: scyigisawesome
      MYSQL_DATABASE: scyig
      MYSQL_USER: scyig
      MYSQL_PASSWORD: scyig

version: '3.3'
services:
  db:
    image: "mysql:5.7.19"
    ports:
      - "127.0.0.1:3306:3306"
    volumes:
      - "mysql-volume:/var/lib/mysql"
    environment:
      MYSQL_ROOT_PASSWORD: scyigisawesome
      MYSQL_DATABASE: scyig
      MYSQL_USER: scyig
      MYSQL_PASSWORD: scyig

volumes:
  mysql-volume:

Declare mysql with a volume
Declare mysql with a volume
