Skip to content

Instantly share code, notes, and snippets.

@george-haddad
Created August 5, 2021 11:05
Show Gist options
  • Save george-haddad/c68e5ac4da22fcabb3da5a88e8cf1e43 to your computer and use it in GitHub Desktop.
Save george-haddad/c68e5ac4da22fcabb3da5a88e8cf1e43 to your computer and use it in GitHub Desktop.
MySQL Quickstart docker command

Need to get a MySQL DB up and runing locally for testing. Command spins a MySQL docker with standard env params for a user, root user and some database initialized.

docker run -p 127.0.0.1:3306:3306 \
  --rm \
  --name mysql-test \
  --env MYSQL_ROOT_PASSWORD=root \
  --env MYSQL_DATABASE=my_database \
  --env MYSQL_USER=alice \
  --env MYSQL_PASSWORD=alice \
  -d mysql:8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment