Skip to content

Commit e04963a

Browse files
AirPettthelamer
authored andcommitted
Add USE clause before including init and remote SQL scripts to run them in the default database.
1 parent 81cc415 commit e04963a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

root/etc/cont-init.d/40-initialise-db

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ $MYSQL_DB_SETUP
7070
EONEWSQL
7171
echo "Setting Up Initial Databases"
7272

73+
echo "USE ${MYSQL_DATABASE};" >> "$tempSqlFile"
74+
7375
# add all sql from a user defined directory on first init
7476
if ([ -e "/config/initdb.d" ] && [ -n "$(/bin/ls -A /config/initdb.d/*.sql 2>/dev/null)" ]); then
7577
cat /config/initdb.d/*.sql >> "$tempSqlFile"

0 commit comments

Comments
 (0)