don't escape single quotes within double quotes
This commit is contained in:
parent
3e7ed82199
commit
4950b472c7
@ -41,7 +41,7 @@ if [ -z "$(ls -A /var/lib/mysql/ 2> /dev/null)" ]; then
|
|||||||
|
|
||||||
# statement to create new SQL database
|
# statement to create new SQL database
|
||||||
printf "DB-CREATE: Generating SQL database create statement for '%s'\n" "$MYSQL_DATABASE"
|
printf "DB-CREATE: Generating SQL database create statement for '%s'\n" "$MYSQL_DATABASE"
|
||||||
echo "CREATE DATABASE IF NOT EXISTS \'$MYSQL_DATABASE\' CHARACTER SET $MYSQL_CHARSET COLLATE $MYSQL_COLLATION;" >> "$sqlCmd"
|
echo "CREATE DATABASE IF NOT EXISTS '$MYSQL_DATABASE' CHARACTER SET $MYSQL_CHARSET COLLATE $MYSQL_COLLATION;" >> "$sqlCmd"
|
||||||
|
|
||||||
# statements to:
|
# statements to:
|
||||||
# cleanup permissions:
|
# cleanup permissions:
|
||||||
@ -55,7 +55,7 @@ if [ -z "$(ls -A /var/lib/mysql/ 2> /dev/null)" ]; then
|
|||||||
echo "GRANT ALL ON *.* TO 'root'@'%' IDENTIFIED BY '$MYSQL_ROOT_PASSWORD' WITH GRANT OPTION;" >> "$sqlCmd"
|
echo "GRANT ALL ON *.* TO 'root'@'%' IDENTIFIED BY '$MYSQL_ROOT_PASSWORD' WITH GRANT OPTION;" >> "$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"
|
||||||
echo "GRANT ALL ON \'$MYSQL_DATABASE\'.* TO \'$MYSQL_USER\'@'%' IDENTIFIED BY \'$MYSQL_PASSWORD\';" >> "$sqlCmd"
|
echo "GRANT ALL ON '$MYSQL_DATABASE'.* TO '$MYSQL_USER'@'%' IDENTIFIED BY '$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"
|
||||||
echo 'DROP DATABASE IF EXISTS test;' >> "$sqlCmd"
|
echo 'DROP DATABASE IF EXISTS test;' >> "$sqlCmd"
|
||||||
|
Loading…
Reference in New Issue
Block a user