From 6b45dbd99c6078801dd49fd22c1f175b9fd19b31 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Fri, 12 Jan 2018 21:58:21 -0600 Subject: [PATCH] services.mysql: properly quote database.name --- nixos/modules/services/databases/mysql.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/databases/mysql.nix b/nixos/modules/services/databases/mysql.nix index 36d5340a306f..5b7390503552 100644 --- a/nixos/modules/services/databases/mysql.nix +++ b/nixos/modules/services/databases/mysql.nix @@ -289,10 +289,10 @@ in # Create initial databases if ! test -e "${cfg.dataDir}/${database.name}"; then echo "Creating initial database: ${database.name}" - ( echo "create database ${database.name};" + ( echo "create database `${database.name}`;" ${optionalString (database ? "schema") '' - echo "use ${database.name};" + echo "use `${database.name}`;" if [ -f "${database.schema}" ] then