Skip to content

Commit 117c233

Browse files
committed
🚑 Fix MySQL init for new installations
1 parent 981df48 commit 117c233

File tree

1 file changed

+12
-1
lines changed
  • proxy-manager/rootfs/etc/cont-init.d

1 file changed

+12
-1
lines changed

proxy-manager/rootfs/etc/cont-init.d/mysql.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,18 @@ if ! bashio::fs.directory_exists "/data/mysql/mysql"; then
3333
done
3434

3535
# Secure the installation.
36-
printf '\nn\n\n\n\n\n' | /usr/bin/mysql_secure_installation
36+
mysql <<-EOSQL
37+
SET @@SESSION.SQL_LOG_BIN=0;
38+
39+
DELETE FROM
40+
mysql.user
41+
WHERE
42+
user NOT IN ('mysql.sys', 'mysqlxsys', 'root', 'mysql')
43+
OR host NOT IN ('localhost');
44+
45+
DROP DATABASE IF EXISTS test;
46+
FLUSH PRIVILEGES;
47+
EOSQL
3748

3849
# Check data integrity and fix corruptions.
3950
mysqlcheck \

0 commit comments

Comments
 (0)