Created
October 5, 2022 16:53
-
-
Save broland07/9d3255e708015ae0d876047adfdfdde5 to your computer and use it in GitHub Desktop.
mysql docker with init scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE DATABASE IF NOT EXISTS `one`; | |
CREATE DATABASE IF NOT EXISTS `two`; | |
CREATE DATABASE IF NOT EXISTS `three`; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
mysql: | |
image: mysql:5.7 | |
volumes: | |
- ./data/db:/var/lib/mysql | |
- ./init:/docker-entrypoint-initdb.d | |
command: --sql_mode="" | |
stop_grace_period: 1m30s | |
ports: | |
- 3306:3306 | |
restart: always | |
environment: | |
MYSQL_ROOT_PASSWORD: securepassword |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE USER 'remote'@'%' IDENTIFIED BY 'remote'; | |
GRANT ALL ON *.* TO 'remote'@'%'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment