From ad625c64a06e16683e997e5a0147508d115f4989 Mon Sep 17 00:00:00 2001 From: Lars Tangvald Date: Fri, 23 Feb 2018 12:38:04 +0100 Subject: [PATCH] Drop user deletion from 5.7 and 8.0 MySQL 5.7 and newer no longer creates the various unwanted users (root@various hosts) that were created in older versions, so the deletion isn't needed, and only creates extra maintenance work if any changes to the system users are made. --- 5.7/docker-entrypoint.sh | 1 - 8.0/docker-entrypoint.sh | 1 - 2 files changed, 2 deletions(-) diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index 08a8256dd..9bd8fd64f 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -143,7 +143,6 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then -- or products like mysql-fabric won't work SET @@SESSION.SQL_LOG_BIN=0; - DELETE FROM mysql.user WHERE user NOT IN ('mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost') ; SET PASSWORD FOR 'root'@'localhost'=PASSWORD('${MYSQL_ROOT_PASSWORD}') ; GRANT ALL ON *.* TO 'root'@'localhost' WITH GRANT OPTION ; ${rootCreate} diff --git a/8.0/docker-entrypoint.sh b/8.0/docker-entrypoint.sh index 5b4a5fa64..9bd8fd64f 100755 --- a/8.0/docker-entrypoint.sh +++ b/8.0/docker-entrypoint.sh @@ -143,7 +143,6 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then -- or products like mysql-fabric won't work SET @@SESSION.SQL_LOG_BIN=0; - DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost') ; SET PASSWORD FOR 'root'@'localhost'=PASSWORD('${MYSQL_ROOT_PASSWORD}') ; GRANT ALL ON *.* TO 'root'@'localhost' WITH GRANT OPTION ; ${rootCreate}