summary refs log tree commit diff
path: root/nixos/modules/services
diff options
context:
space:
mode:
authorRobin Stumm <serverkorken@gmail.com>2019-01-17 18:59:32 +0100
committerRobin Stumm <serverkorken@gmail.com>2019-01-17 19:08:50 +0100
commit429c0bf60cc6aba6e80b4528215a9494bdfaf2c3 (patch)
tree5ddeb2537506496f0d26ed6f3373808683e978e1 /nixos/modules/services
parent2dbaab7afe1cd796fc4dbe3383207f2be5060b75 (diff)
downloadnixpkgs-429c0bf60cc6aba6e80b4528215a9494bdfaf2c3.tar
nixpkgs-429c0bf60cc6aba6e80b4528215a9494bdfaf2c3.tar.gz
nixpkgs-429c0bf60cc6aba6e80b4528215a9494bdfaf2c3.tar.bz2
nixpkgs-429c0bf60cc6aba6e80b4528215a9494bdfaf2c3.tar.lz
nixpkgs-429c0bf60cc6aba6e80b4528215a9494bdfaf2c3.tar.xz
nixpkgs-429c0bf60cc6aba6e80b4528215a9494bdfaf2c3.tar.zst
nixpkgs-429c0bf60cc6aba6e80b4528215a9494bdfaf2c3.zip
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.
Diffstat (limited to 'nixos/modules/services')
-rw-r--r--nixos/modules/services/databases/mysql.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/nixos/modules/services/databases/mysql.nix b/nixos/modules/services/databases/mysql.nix
index df6f3876585..1ba878957ed 100644
--- a/nixos/modules/services/databases/mysql.nix
+++ b/nixos/modules/services/databases/mysql.nix
@@ -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
             ''}