Skip to content

Commit ad625c6

Browse files
committed
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.
1 parent c5ce5cc commit ad625c6

File tree

2 files changed

+0
-2
lines changed

2 files changed

+0
-2
lines changed

5.7/docker-entrypoint.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then
143143
-- or products like mysql-fabric won't work
144144
SET @@SESSION.SQL_LOG_BIN=0;
145145
146-
DELETE FROM mysql.user WHERE user NOT IN ('mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost') ;
147146
SET PASSWORD FOR 'root'@'localhost'=PASSWORD('${MYSQL_ROOT_PASSWORD}') ;
148147
GRANT ALL ON *.* TO 'root'@'localhost' WITH GRANT OPTION ;
149148
${rootCreate}

8.0/docker-entrypoint.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then
143143
-- or products like mysql-fabric won't work
144144
SET @@SESSION.SQL_LOG_BIN=0;
145145
146-
DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost') ;
147146
SET PASSWORD FOR 'root'@'localhost'=PASSWORD('${MYSQL_ROOT_PASSWORD}') ;
148147
GRANT ALL ON *.* TO 'root'@'localhost' WITH GRANT OPTION ;
149148
${rootCreate}

0 commit comments

Comments
 (0)