nixos/mysql: fix option ensureDatabases

The database name needs to be quoted
in case it contains special characters
so the MySQL service does not fail to start.
This commit is contained in:
Robin Stumm 2019-01-17 18:59:32 +01:00
parent 2dbaab7afe
commit 429c0bf60c

View File

@ -362,7 +362,7 @@ in
${optionalString (cfg.ensureDatabases != []) ''
(
${concatMapStrings (database: ''
echo "CREATE DATABASE IF NOT EXISTS ${database};"
echo "CREATE DATABASE IF NOT EXISTS \`${database}\`;"
'') cfg.ensureDatabases}
) | ${mysql}/bin/mysql -u root -N
''}