From e6b0725fcc01fd8990cce5cf7dd663f626938762 Mon Sep 17 00:00:00 2001 From: Alexander Date: Thu, 10 Oct 2019 12:30:17 +0700 Subject: [PATCH] - fix MYSQL_ROOT_PASSWORD=127.0.0.1 case Now DB initialization failed as CREATE USER operation fails because of https://bugs.mysql.com/bug.php?id=28331 In short following sequence fails as FLUSH PRIVILEGES required in the middle: DELETE FROM mysql.user...; CREATE USER ...; As 127.0.0.1 already present container failed in reqlated part of entrypoint --- docker-entrypoint.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 7ee5efde..19ad966b 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -147,6 +147,7 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then SET @@SESSION.SQL_LOG_BIN=0; DELETE FROM mysql.user WHERE user NOT IN ('mysql.sys', 'mysqlxsys', 'root') OR host NOT IN ('localhost') ; + FLUSH PRIVILEGES ; SET PASSWORD FOR 'root'@'localhost'=PASSWORD('${MYSQL_ROOT_PASSWORD}') ; GRANT ALL ON *.* TO 'root'@'localhost' WITH GRANT OPTION ; ${rootCreate}