Skip to content

Support multiple comma-separated databases in "MYSQL_DATABASE" #63

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

elifarley
Copy link

@elifarley elifarley commented Jun 9, 2016

For now, SQL scripts inside "/docker-entrypoint-initdb.d" will be executed on the first database only.


This change is Reviewable

elifarley added 2 commits June 9, 2016 13:08
For now, SQL scripts inside "/docker-entrypoint-initdb.d" will be executed on the first database only.
@elifarley elifarley changed the title Support multiple space-separated databases in "MYSQL_DATABASE" Support multiple comma-separated databases in "MYSQL_DATABASE" Jun 9, 2016
@tianon
Copy link
Contributor

tianon commented Jul 7, 2016

I think docker-library/mysql#86 (comment) sums up the current state of opinion on "how to create multiple databases".

@sirgalleto
Copy link

Why are avoiding this PR?

@elifarley
Copy link
Author

I don't think this PR is overly complex - it only adds 10 lines and removes 3.

And since users can already provide 1 database name, it can be argued that providing 2 or more database names separated by commas is something users can expect to 'just work'.

@yosifkit
Copy link
Contributor

Why are avoiding this PR?

I still agree with @tianon. The solution is to drop scripts in /docker-entrypoint-initdb.d. I think it should be closed like docker-library/mysql#86.

@sirgalleto
Copy link

Yeah so, I'm trying to use that thing with Docker compose, and at this moment I have many problems with that execution.

@yosifkit
Copy link
Contributor

Compose supports either method of getting the custom script into the container; a volume of the single script to mount at run (volumes: \n - /path/to/custom.sql:/docker-entrypoint-initdb.d/custom.sql), or a build directive with a simple Dockerfile:

FROM mariadb:10
COPY ./custom.sql /docker-entrypoint-initdb.d/

@sirgalleto
Copy link

Thanks for your help, I had a problem with my Docker volumes and the script was not running. It's working right now.

@yosifkit
Copy link
Contributor

Closing since it can already be solved with custom scripts in docker-entrypoint-initdb.d.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants