From 73e36aed5445a3b10cfb77b399a306b0c148b928 Mon Sep 17 00:00:00 2001 From: Adrian Siminiceanu Date: Thu, 8 Sep 2022 13:36:21 +0300 Subject: [PATCH] Override time-zone option when initializing database to make sure that the unknown timezone (if provided) does not break the start --- percona-server-5.6/ps-entry.sh | 4 ++-- percona-server-5.7/ps-entry.sh | 4 ++-- percona-server-8.0/ps-entry.sh | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/percona-server-5.6/ps-entry.sh b/percona-server-5.6/ps-entry.sh index cbe018c0..5473eb46 100755 --- a/percona-server-5.6/ps-entry.sh +++ b/percona-server-5.6/ps-entry.sh @@ -104,11 +104,11 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then echo 'Initializing database' # "Other options are passed to mysqld." (so we pass all "mysqld" arguments directly here) - mysql_install_db --datadir="$DATADIR" --rpm --keep-my-cnf "${@:2}" + mysql_install_db --datadir="$DATADIR" --rpm --keep-my-cnf "${@:2}" --default-time-zone=SYSTEM echo 'Database initialized' SOCKET="$(_get_config 'socket' "$@")" - "$@" --skip-networking --socket="${SOCKET}" & + "$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" & pid="$!" mysql=( mysql --protocol=socket -uroot -hlocalhost --socket="${SOCKET}" ) diff --git a/percona-server-5.7/ps-entry.sh b/percona-server-5.7/ps-entry.sh index 4be247d6..b6538770 100755 --- a/percona-server-5.7/ps-entry.sh +++ b/percona-server-5.7/ps-entry.sh @@ -103,7 +103,7 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then mkdir -p "$DATADIR" echo 'Initializing database' - "$@" --initialize-insecure --skip-ssl + "$@" --initialize-insecure --skip-ssl --default-time-zone=SYSTEM echo 'Database initialized' if command -v mysql_ssl_rsa_setup > /dev/null && [ ! -e "$DATADIR/server-key.pem" ]; then @@ -114,7 +114,7 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then fi SOCKET="$(_get_config 'socket' "$@")" - "$@" --skip-networking --socket="${SOCKET}" & + "$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" & pid="$!" mysql=( mysql --protocol=socket -uroot -hlocalhost --socket="${SOCKET}" --password="" ) diff --git a/percona-server-8.0/ps-entry.sh b/percona-server-8.0/ps-entry.sh index e356917d..e4f4ec99 100755 --- a/percona-server-8.0/ps-entry.sh +++ b/percona-server-8.0/ps-entry.sh @@ -103,7 +103,7 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then mkdir -p "$DATADIR" echo 'Initializing database' - "$@" --initialize-insecure + "$@" --initialize-insecure --default-time-zone=SYSTEM echo 'Database initialized' if command -v mysql_ssl_rsa_setup > /dev/null && [ ! -e "$DATADIR/server-key.pem" ]; then @@ -114,7 +114,7 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then fi SOCKET="$(_get_config 'socket' "$@")" - "$@" --skip-networking --socket="${SOCKET}" & + "$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" & pid="$!" mysql=( mysql --protocol=socket -uroot -hlocalhost --socket="${SOCKET}" --password="" )