move wildcard within quotes for table spec

This commit is contained in:
Asif Bacchus 2020-11-27 02:12:20 -07:00
parent 59e26b7ac7
commit a6177a5bc8

View File

@ -55,7 +55,7 @@ if [ -z "$(ls -A /var/lib/mysql/ 2> /dev/null)" ]; then
printf "GRANT ALL ON *.* TO 'root'@'%%' IDENTIFIED BY '%s' WITH GRANT OPTION;" "$MYSQL_ROOT_PASSWORD" >> "$sqlCmd" printf "GRANT ALL ON *.* TO 'root'@'%%' IDENTIFIED BY '%s' WITH GRANT OPTION;" "$MYSQL_ROOT_PASSWORD" >> "$sqlCmd"
if [ -n "$MYSQL_USER" ] && [ -n "$MYSQL_PASSWORD" ]; then if [ -n "$MYSQL_USER" ] && [ -n "$MYSQL_PASSWORD" ]; then
printf "DB-CREATE: Generating SQL permissions statement for '%s'\n" "$MYSQL_USER" printf "DB-CREATE: Generating SQL permissions statement for '%s'\n" "$MYSQL_USER"
printf "GRANT ALL ON '%s'.* TO '%s'@'%%' IDENTIFIED BY '%s';" "$MYSQL_DATABASE" "$MYSQL_USER" "$MYSQL_PASSWORD" >> "$sqlCmd" printf "GRANT ALL ON '%s.*' TO '%s'@'%%' IDENTIFIED BY '%s';" "$MYSQL_DATABASE" "$MYSQL_USER" "$MYSQL_PASSWORD" >> "$sqlCmd"
fi fi
printf "DB-CREATE: Generating statement to drop 'test' table\n" printf "DB-CREATE: Generating statement to drop 'test' table\n"
printf 'DROP DATABASE IF EXISTS test;' >> "$sqlCmd" printf 'DROP DATABASE IF EXISTS test;' >> "$sqlCmd"