Skip to content

Instantly share code, notes, and snippets.

@dkhorev
Last active August 23, 2022 20:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dkhorev/8456632e966f097d73acb08e9b7939fc to your computer and use it in GitHub Desktop.
Save dkhorev/8456632e966f097d73acb08e9b7939fc to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# first run
docker run -d --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=secret \
-e MYSQL_DATABASE=laravel -e MYSQL_USER=laravel -e MYSQL_PASSWORD=secret \
-v ~/mysql-data:/var/lib/mysql mysql:8
# stop service
docker stop mysql
# start service
docker start mysql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment