Unable to load database dump in in /docker-entrypoint-initdb.d
When I try to load a SQL dump at init I am getting an error that the database does not exist, however it seems to be included the double quotes in the name (See Unknown database '"my_database"' in the logs). Switching the image to mariadb:10.4 with no other changes populates the database as expected.
docker-compose.yml
version: '3.3'
services:
app_db:
image: bianjp/mariadb-alpine
restart: "no"
volumes:
- ./initdb.d:/docker-entrypoint-initdb.d
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: my_database
MYSQL_USER: my_user
MYSQL_PASSWORD: my_password
Container logs
app_db_1 | Database initialized
app_db_1 | MySQL init process in progress...
app_db_1 |
app_db_1 | /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/my_database.sql
app_db_1 | ERROR 1049 (42000): Unknown database '"my_database"'
Using the mariadb images, I get these logs with the same config/volumes (some lines omitted)
app_db_1 | Database initialized
app_db_1 | MySQL init process in progress...
app_db_1 |
app_db_1 | /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/my_database.sql
app_db_1 |
app_db_1 | MySQL init process done. Ready for start up.
app_db_1 | 2019-10-30 1:47:02 0 [Note] mysqld: ready for connections.
app_db_1 | Version: '10.4.8-MariaDB-1:10.4.8+maria~bionic' socket: '/var/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution
Same issue here. Since you've reported it long ago and no word was said yet, it seems that this project has been abandoned.
Hi @edgardmota - I made a Docker image for MariaDB on Alpine Linux that loads the docker-entrypoint-initdb.d files correctly. It's based on the latest MariaDB base image files with a few tweaks for Alpine.
https://github.com/doublesharp/docker-mariadb-alpine
Sorry, but I didn't use this image anymore and have no interest in maintaining it. I'll archive this repository soon.