Answer the question
In order to leave comments, you need to log in
Why are there no rights to second base in the dump?
I dump 2 databases with the command
mysqldump --skip-lock-tables --databases project project-test | sed -e 's/DEFINER=[^*]*\*/\*/g' | gzip -c" > project.sql.gz
mariadb:
image: mariadb:10.4.10
ports:
- "${MYSQL_PORT}:3306"
networks:
iternal:
volumes:
- mariadb:/var/lib/mysql
- ./docker/mariadb/dump:/docker-entrypoint-initdb.d/
environment:
MYSQL_ROOT_PASSWORD: '${MYSQL_ROOT_PASSWORD}'
MYSQL_DATABASE: '${MYSQL_DATABASE}'
MYSQL_USER: '${MYSQL_USER}'
MYSQL_PASSWORD: '${MYSQL_PASSWORD}'
TZ: 'Europe/Moscow'
Answer the question
In order to leave comments, you need to log in
It's like that. Write a script that creates users and databases and adds GRANTs to them and place it in the directory /docker-entrypoint-initdb.d
, you can also place dumps there, everything will be applied automatically.
See the README on the Docker HUB section "Initializing a fresh instance".
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question