yobasystems / alpine-mariadb

MariaDB running on Alpine Linux [Docker]
https://hub.docker.com/r/yobasystems/alpine-mariadb/
237 stars 71 forks source link

execution of sql script in /docker-entrypoint-initdb.d/* fails #22

Closed dm4tze closed 5 years ago

dm4tze commented 5 years ago

In the run script you are executing all sql scripts whit the mysql command like this *.sql) echo "$0: running $f"; mysql -u $MYSQL_USER -p$MYSQL_PASSWORD $MYSQL_DATABASE < "$f"; but it seems the database isn't started yet, so mysql is not able to connect to the server.

I tried to start the daemon before executing mysql but I wasn't successful, so I just replaced the line with *.sql) echo "$0: running $f"; /usr/bin/mysqld --user=mysql --bootstrap --skip-name-resolve < $f; echo ;; This is working for me but I'm not a mariadb expert, so I don't know if this is a feasible solution.