Skip to content

Instantly share code, notes, and snippets.

@ayuthmang
Last active February 10, 2020 17:16
Show Gist options
  • Save ayuthmang/3d5143b3db429ae10e22a7b200d91c2f to your computer and use it in GitHub Desktop.
Save ayuthmang/3d5143b3db429ae10e22a7b200d91c2f to your computer and use it in GitHub Desktop.
docker-compose mysql snippet

MySQL Snippets

$ docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:5.7.27

CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON 'database'.* TO 'database'@'localhost';
FLUSH PRIVILEGES;

Postgres Snippets

docker run -e PGADMIN_DEFAULT_EMAIL=root@example -e PGADMIN_DEFAULT_PASSWORD=password -p 80:80 --rm dpage/pgadmin4

version: '3.7'
services:
mysql:
image: mysql:5.7.27
restart: always
ports:
- 3306:3306
environment:
MYSQL_ROOT_PASSWORD: example
adminer:
image: adminer
restart: always
ports:
- 8080:8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment