docker-mariadb-alpine icon indicating copy to clipboard operation
docker-mariadb-alpine copied to clipboard

Unable to load database dump in in /docker-entrypoint-initdb.d

Open doublesharp opened this issue 6 years ago • 3 comments

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

doublesharp avatar Oct 30 '19 01:10 doublesharp

Same issue here. Since you've reported it long ago and no word was said yet, it seems that this project has been abandoned.

edgardmota avatar Jan 29 '21 14:01 edgardmota

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

doublesharp avatar Feb 01 '21 06:02 doublesharp

Sorry, but I didn't use this image anymore and have no interest in maintaining it. I'll archive this repository soon.

bianjp avatar Feb 01 '21 10:02 bianjp