diff --git a/mysql/README.md b/mysql/README.md index eca5f7106afa..516df1e48232 100644 --- a/mysql/README.md +++ b/mysql/README.md @@ -79,6 +79,18 @@ a user/password was supplied (via the `MYSQL_USER` and `MYSQL_PASSWORD` environment variables) then that user account will be granted (`GRANT ALL`) access to this database. +## Executing Additional Scripts + +You can add additional scripts to be included in the `--init-file` by placing +the `*.sql` scripts in the `/docker-entrypoint-initdb.d` directory in your +docker container. There are limitations to the `--init-file` listed on the +[mysql documentation](http://dev.mysql.com/doc/refman/5.0/en/server-options.html#option_mysqld_init-file). +An example script may look like this: + + CREATE USER 'foo'@'%' IDENTIFIED BY 'foo'; + CREATE DATABASE foobar; + GRANT ALL on foobar.* to 'foo'@'%'; + # Caveats If there is no database when `mysql` starts in a container, then `mysql` will diff --git a/mysql/content.md b/mysql/content.md index 20d61b9db9ea..8b2c2b44bb8a 100644 --- a/mysql/content.md +++ b/mysql/content.md @@ -67,6 +67,18 @@ a user/password was supplied (via the `MYSQL_USER` and `MYSQL_PASSWORD` environment variables) then that user account will be granted (`GRANT ALL`) access to this database. +## Executing Additional Scripts + +You can add additional scripts to be included in the `--init-file` by placing +the `*.sql` scripts in the `/docker-entrypoint-initdb.d` directory in your +docker container. There are limitations to the `--init-file` listed on the +[mysql documentation](http://dev.mysql.com/doc/refman/5.0/en/server-options.html#option_mysqld_init-file). +An example script may look like this: + + CREATE USER 'foo'@'%' IDENTIFIED BY 'foo'; + CREATE DATABASE foobar; + GRANT ALL on foobar.* to 'foo'@'%'; + # Caveats If there is no database when `mysql` starts in a container, then `mysql` will