Skip to content

Instantly share code, notes, and snippets.

@zymtx5g79k
Created September 30, 2021 12:30
Show Gist options
  • Save zymtx5g79k/6c9a7e1e1ca95a22611ec4e0d39e94fc to your computer and use it in GitHub Desktop.
Save zymtx5g79k/6c9a7e1e1ca95a22611ec4e0d39e94fc to your computer and use it in GitHub Desktop.
mysql in doscker
docker-compose exec mysql mysql -u root -p
CREATE USER 'root'@'%' IDENTIFIED BY 'MYSQL_ROOT_PASSWORD';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
networks:
dev:
driver: bridge
attachable: true
services:
mysql:
command: --default-authentication-plugin=mysql_native_password
image: mysql:latest
expose:
- 3306
ports:
- '3306:3306'
volumes:
- mysql-data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: MYSQL_ROOT_PASSWORD
MYSQL_ROOT_HOST: 0.0.0.0
restart: 'no'
networks:
- dev
version: '3.5'
volumes:
mysql-data:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment