12 lines
349 B
Bash
Executable file
12 lines
349 B
Bash
Executable file
file_env 'MYSQL_DATABASES'
|
|
if [ "$MYSQL_DATABASES" ]; then
|
|
for databaseName in $MYSQL_DATABASES; do
|
|
echo "CREATE DATABASE IF NOT EXISTS \`$databaseName\` ;" | "${mysql[@]}"
|
|
done
|
|
fi
|
|
if [ "$MYSQL_DATABASES" ]; then
|
|
for databaseName in $MYSQL_DATABASES; do
|
|
echo "GRANT ALL ON \`$databaseName\`.* TO '$MYSQL_USER'@'%' ;" | "${mysql[@]}"
|
|
done
|
|
fi
|