Skip to content

Commit 159076f

Browse files
author
Guy Matz
committed
Added an ENV var to be set to an additional - optional - directory for mysql initialzition files
1 parent b39c1c3 commit 159076f

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Diff for: percona-server-5.7/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ Set to `1` to allow the container to be started with enabled ROCKSDB engine.
8686

8787
Set to `1` will skip starting the `mysqld` process and will run only the initialization part if MySQL was not initialized before.
8888

89+
## `MYSQL_INIT_DB`
90+
91+
Set to directory where initialization files reside. This is an additional directory for initialzation, on top of the default directory, /docker-entrypoint-initdb.d
92+
8993
# Notes, Tips, Gotchas
9094

9195
## Secure Container Startup

Diff for: percona-server-5.7/ps-entry.sh

+5
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,11 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then
202202
process_init_file "$f" "${mysql[@]}"
203203
done
204204

205+
ls $MYSQL_INIT_DIR > /dev/null
206+
for f in ${MYSQL_INIT_DIR}/*; do
207+
process_init_file "$f" "${mysql[@]}"
208+
done
209+
205210
if [ ! -z "$MYSQL_ONETIME_PASSWORD" ]; then
206211
"${mysql[@]}" <<-EOSQL
207212
ALTER USER 'root'@'%' PASSWORD EXPIRE;

0 commit comments

Comments
 (0)