Skip to content

Commit 8a3fc86

Browse files
check empty MYSQL_USER (#835)
1 parent f4929d2 commit 8a3fc86

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

database/mariadb/create-testing-database.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,10 @@
22

33
/usr/bin/mariadb --user=root --password="$MYSQL_ROOT_PASSWORD" <<-EOSQL
44
CREATE DATABASE IF NOT EXISTS testing;
5+
EOSQL
6+
7+
if [ -n "$MYSQL_USER" ]; then
8+
/usr/bin/mariadb --user=root --password="$MYSQL_ROOT_PASSWORD" <<-EOSQL
59
GRANT ALL PRIVILEGES ON \`testing%\`.* TO '$MYSQL_USER'@'%';
610
EOSQL
11+
fi

database/mysql/create-testing-database.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,10 @@
22

33
mysql --user=root --password="$MYSQL_ROOT_PASSWORD" <<-EOSQL
44
CREATE DATABASE IF NOT EXISTS testing;
5+
EOSQL
6+
7+
if [ -n "$MYSQL_USER" ]; then
8+
mysql --user=root --password="$MYSQL_ROOT_PASSWORD" <<-EOSQL
59
GRANT ALL PRIVILEGES ON \`testing%\`.* TO '$MYSQL_USER'@'%';
610
EOSQL
11+
fi

0 commit comments

Comments
 (0)