Closed Tanguy-Magnaudet closed 11 months ago
MariaDB/server@306e439c6d19b578fdd12b640a6f9a81ed2737e1 in MariaDB Server 10.4 introduced symbolic links such as mariadb
for mysql
. Later, MariaDB Server 10.5 renamed the executables to MariaDB names and introduced symbolic links such as mysql
for mariadb
. Finally, in MariaDB/server@9656356b550079234185f430fe6b4190f435f3e6 (MariaDB Server 11.0) the symbolic links were moved into a separate package.
And the MariaDB image doesn't include the links: https://mariadb.org/mariadb-server-docker-official-images-healthcheck-without-mysqladmin/
A way as an init.sh
without the execute permissions is:
docker_process_sql <<-EOSQL
CREATE DATABASE IF NOT EXISTS $DB_NAME;
GRANT ALL PRIVILEGES ON $DB_NAME.* TO $DB_USER@'%' IDENTIFIED BY '$DB_PASSWORD';"
CREATE DATABASE IF NOT EXISTS $DB_HERACLES;
GRANT ALL PRIVILEGES ON $DB_HERACLES.* TO $DB_USER@'%' IDENTIFIED BY '$DB_PASSWORD';"
EOSQL
The docker_process_sql
is part of the entrypoint and without execute permissions on the script it is run in the same context.
Note the outstanding feature request https://jira.mariadb.org/browse/MDEV-27638 if you want to make a contribution to the docker entrypoint to support this natively.
FLUSH PRIVILEGES
isn't needed after creating grants or users.
Hello,
I'm trying to init my db with a .sh file (because I want to fetch Env variable), put it tells me mysql command doesn't exists. :
The Dockerfile :
And the initdb.sh :
Any idea why it doesn't work ?