DataBase/MYSQL
How to run mySQL through docker-compose.
Naranjito
2022. 1. 13. 18:45
- docker-compose.yml
Run mySQL through docker-compose.
version: '3.1'
services:
db:
image: mysql
command: --default-authentication-plugin=mysql_native_password
environment:
MYSQL_ROOT_PASSWORD: jh
MYSQL_DATABASE: DB_SQLSTK
volumes:
- ./DB_SQLSTK_FULL_FOR_BOOK_20210521.sql:/docker-entrypoint-initdb.d/schema.sql:ro
ports:
- 3306:3306
adminer:
image: adminer
ports:
- 8080:8080
~
"docker-compose.yml" 19L, 394C
How to input the SQL file through database is set up the volume.
volumes:
- ./DB_SQLSTK_FULL_FOR_BOOK_20210521.sql:/docker-entrypoint-initdb.d/schema.sql:ro