I want to load a csv into my mysql container.
This is my docker-compose:
version: '3.7'
services:
db:
image: mysql
ports:
- 3306:3306
environment:
- MYSQL_ROOT_PASSWORD=root123
- MYSQL_DATABASE=test
- MYSQL_USER=test
- MYSQL_PASSWORD=test123
volumes:
- './init.sql:/docker-entrypoint-initdb.d/init.sql'
- './init_data:/docker-entrypoint-initdb.d/init_data'
It does create the table, but it doesn't load the csv into the table.
As far as I have researched I have to pass this as an argument to mysql image, but I dont know how to add an argument by docker-compose.
--secure-file-priv=docker-entrypoint-initdb.d
This is what I am following.
But I don't want to use docker run.
Any help or tips are welcomed.