Skip to content

Commit

Permalink
Added an ENV var to be set to an additional - optional - directory fo…
Browse files Browse the repository at this point in the history
…r mysql initialzition files
  • Loading branch information
Guy Matz committed Jun 13, 2022
1 parent b39c1c3 commit 159076f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions percona-server-5.7/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ Set to `1` to allow the container to be started with enabled ROCKSDB engine.

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

## `MYSQL_INIT_DB`

Set to directory where initialization files reside. This is an additional directory for initialzation, on top of the default directory, /docker-entrypoint-initdb.d

# Notes, Tips, Gotchas

## Secure Container Startup
Expand Down
5 changes: 5 additions & 0 deletions percona-server-5.7/ps-entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,11 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then
process_init_file "$f" "${mysql[@]}"
done

ls $MYSQL_INIT_DIR > /dev/null
for f in ${MYSQL_INIT_DIR}/*; do
process_init_file "$f" "${mysql[@]}"
done

if [ ! -z "$MYSQL_ONETIME_PASSWORD" ]; then
"${mysql[@]}" <<-EOSQL
ALTER USER 'root'@'%' PASSWORD EXPIRE;
Expand Down

0 comments on commit 159076f

Please sign in to comment.