Skip to content

Commit 40cb3eb

Browse files
committed
Simplify root user
1 parent 9ee33a3 commit 40cb3eb

File tree

1 file changed

+1
-3
lines changed
  • root/etc/s6-overlay/s6-rc.d/init-mariadb-initdb

1 file changed

+1
-3
lines changed

root/etc/s6-overlay/s6-rc.d/init-mariadb-initdb/run

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ if [[ ! -d "${DATADIR}/mysql" ]]; then
3030

3131
# set basic sql command
3232
cat >"${tempSqlFile}" <<-EOSQL
33-
DELETE FROM mysql.user WHERE user <> 'mariadb.sys';
33+
DELETE FROM mysql.user WHERE user <> 'mariadb.sys' AND user <> 'root';
3434
EOSQL
3535

3636
if [[ "${#MYSQL_ROOT_PASSWORD}" -lt "4" ]]; then
@@ -57,8 +57,6 @@ EOM
5757
cat >>"${tempSqlFile}" <<-EONEWSQL
5858
$MYSQL_PASS
5959
GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION ;
60-
DROP USER 'root'@'localhost';
61-
GRANT ALL ON *.* TO 'root'@'localhost' IDENTIFIED VIA unix_socket WITH GRANT OPTION ;
6260
DROP DATABASE IF EXISTS test ;
6361
$MYSQL_DB_SETUP
6462
EONEWSQL

0 commit comments

Comments
 (0)