Closed vstanchev closed 3 years ago
As a workaround I added the following script to the /docker-entrypoint-initdb.d/
(apparently /docker-entrypoint-init.d/
is not used in the mariadb image as opposed to all other alpine images, I guess this is because the server needs to be started before init scripts?)
#!/usr/bin/env bash
set -e
TEST_DATABASE="${MYSQL_DATABASE}_test"
mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" -e "CREATE DATABASE IF NOT EXISTS ${TEST_DATABASE}"
mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" -e "GRANT ALL ON \`${TEST_DATABASE}\`.* TO '${MYSQL_USER}'@'%'"
Params for make commands described at https://github.com/wodby/mariadb#orchestration-actions
I want to create a second database on the same container (for tests). I see that there is an
actions.mk
file with some query actions which I can call in an init script located at/docker-entrypoint-init.d/
. However, I always get the error/usr/local/bin/actions.mk:32: *** Required parameter is missing: query. Stop.
I tried entering the container and executing a query from there but it's the same error.
What I'm doing wrong? Should the query be passed in another way?
I'm using the
10.3-3.4.11
image.