Skip to content

Provide mechanism to extend mysql image with additional SQL init scripts #24

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
yarosla opened this issue Nov 13, 2014 · 11 comments
Closed

Comments

@yarosla
Copy link

yarosla commented Nov 13, 2014

Please provide mechanism to extend this image by providing additional SQL scripts to be executed upon initial server startup.

See official postgres image for example on how this can be done (“How to extend this image” section in readme).

You can arrange special directory for SQL files. All *.sql files found in that directory shall be appended to $TEMP_FILE that will be passed as --init-file parameter to MySQL.

@yosifkit
Copy link
Member

One problem here is that --init-file is very picky on syntax.

Each statement must be on a single line and should not include comments. -mysql.com

We talked about using --bootstrap in #18, but it does not work with GRANTs.

It would be nice to have extra SQL scripts on startup though.

williamsbdev added a commit to williamsbdev/mysql that referenced this issue Dec 3, 2014
This will close both docker-library#18 and docker-library#24.

The scripts are located in the /docker-entrypoint-initdb.d directory.

Paired on this with @benkiefer
@johngian
Copy link

This would be really useful.
+1

@jorgemoralespou
Copy link

It is not very usable without this feature. I have done as williamsdev in his PR for make it woking for me, but something from the official images should come, as it does in the postgres one.

@ltangvald
Copy link
Collaborator

The changes we suggested in #53 should make this simpler to add, too, as the init sql is now just passed to the mysql client.

@tophsic
Copy link

tophsic commented Apr 3, 2015

+1

Actually, I did a similar thing as @williamsbdev in #31

@sherter
Copy link
Contributor

sherter commented May 2, 2015

+1
any news on this?

@sweco-semhul
Copy link

+1

1 similar comment
@probepark
Copy link

+1

@ltangvald
Copy link
Collaborator

This would be fairly simple to add with the new system for initializing the database used in #53.
However, that change is meant to be a temporary workaround, so it's probably best to do this in a way that doesn't depend on it.

@tianon
Copy link
Member

tianon commented Jun 30, 2015

@ltangvald does that mean we're going to have a proper way to invoke instructions against /var/lib/mysql properly ala postgres --single without the silly limitations --init-file has? 😄

@roytruelove
Copy link

+1

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

No branches or pull requests