File tree Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -174,8 +174,13 @@ docker_init_client_command() {
174174 mysql=( mysql --defaults-file=" ${PASSFILE} " --protocol=socket -uroot -hlocalhost --socket=" ${SOCKET} " )
175175}
176176
177- # Creates initial database users and schema
177+ # Initializes database with timezone info and root password, plus optional extra db/user
178178docker_setup_db () {
179+ # Load timezone info into database
180+ if [ -z " $MYSQL_INITDB_SKIP_TZINFO " ]; then
181+ # sed is for https://bugs.mysql.com/bug.php?id=20545
182+ mysql_tzinfo_to_sql /usr/share/zoneinfo | sed ' s/Local time zone must be set--see zic manual page/FCTY/' | " ${mysql[@]} " mysql
183+ fi
179184 # Generate random root password
180185 if [ ! -z " $MYSQL_RANDOM_ROOT_PASSWORD " ]; then
181186 export MYSQL_ROOT_PASSWORD=" $( pwgen -1 32) "
@@ -244,12 +249,6 @@ mysql_expire_root_user() {
244249 fi
245250}
246251
247- # Load timezone info into database
248- docker_load_tzinfo () {
249- # sed is for https://bugs.mysql.com/bug.php?id=20545
250- mysql_tzinfo_to_sql /usr/share/zoneinfo | sed ' s/Local time zone must be set--see zic manual page/FCTY/' | " ${mysql[@]} " mysql
251- }
252-
253252_main () {
254253 mysql_note " Entrypoint script for MySQL Server ${MYSQL_VERSION} started."
255254
@@ -280,10 +279,6 @@ _main() {
280279 mysql_note " Temporary server started."
281280
282281
283- if [ -z " $MYSQL_INITDB_SKIP_TZINFO " ]; then
284- docker_load_tzinfo
285- fi
286-
287282 docker_setup_db
288283
289284 echo
You can’t perform that action at this time.
0 commit comments