Merge pull request #25931 from bachp/mysql-17.09

mysql service: change default data directory for 17.09
This commit is contained in:
Graham Christensen 2017-05-29 10:22:07 -04:00 committed by GitHub
commit fde29b2b06

View File

@ -72,7 +72,7 @@ in
dataDir = mkOption { dataDir = mkOption {
type = types.path; type = types.path;
default = "/var/mysql"; # !!! should be /var/db/mysql example = "/var/lib/mysql";
description = "Location where MySQL stores its table files"; description = "Location where MySQL stores its table files";
}; };
@ -166,6 +166,10 @@ in
config = mkIf config.services.mysql.enable { config = mkIf config.services.mysql.enable {
services.mysql.dataDir =
mkDefault (if versionAtLeast config.system.stateVersion "17.09" then "/var/lib/mysql"
else "/var/mysql");
users.extraUsers.mysql = { users.extraUsers.mysql = {
description = "MySQL server user"; description = "MySQL server user";
group = "mysql"; group = "mysql";