From 2e4f2224f31e101d07c1e6a7c0da8245fde725c9 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Thu, 19 Apr 2018 10:20:42 -0700 Subject: [PATCH] Fix a few minor issues with docker-entrypoint.sh for 8.0.11 --- 8.0/Dockerfile | 2 +- 8.0/docker-entrypoint.sh | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 6d025f2bb..1d471ad20 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -44,7 +44,7 @@ RUN set -ex; \ apt-key list > /dev/null ENV MYSQL_MAJOR 8.0 -ENV MYSQL_VERSION 8.0.4-rc-1debian9 +ENV MYSQL_VERSION 8.0.11-1debian9 RUN echo "deb http://repo.mysql.com/apt/debian/ stretch mysql-${MYSQL_MAJOR}" > /etc/apt/sources.list.d/mysql.list diff --git a/8.0/docker-entrypoint.sh b/8.0/docker-entrypoint.sh index 9bd8fd64f..4f71b04a7 100755 --- a/8.0/docker-entrypoint.sh +++ b/8.0/docker-entrypoint.sh @@ -59,7 +59,9 @@ _check_config() { # latter only show values present in config files, and not server defaults _get_config() { local conf="$1"; shift - "$@" --verbose --help --log-bin-index="$(mktemp -u)" 2>/dev/null | awk '$1 == "'"$conf"'" { print $2; exit }' + "$@" --verbose --help --log-bin-index="$(mktemp -u)" 2>/dev/null \ + | awk '$1 == "'"$conf"'" && /^[^ \t]/ { sub(/^[^ \t]+[ \t]+/, ""); print; exit }' + # match "datadir /some/path with/spaces in/it here" but not "--xyz=abc\n datadir (xyz)" } # allow the container to be started with `--user` @@ -143,7 +145,7 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then -- or products like mysql-fabric won't work SET @@SESSION.SQL_LOG_BIN=0; - SET PASSWORD FOR 'root'@'localhost'=PASSWORD('${MYSQL_ROOT_PASSWORD}') ; + ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}' ; GRANT ALL ON *.* TO 'root'@'localhost' WITH GRANT OPTION ; ${rootCreate} DROP DATABASE IF EXISTS test ;