nixos/mysql: fix permission error during first startup (#331296)

This commit is contained in:
Aleksana 2024-11-11 18:49:32 +08:00 committed by GitHub
commit dbed5a6265
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -334,6 +334,12 @@ in
environment.etc."my.cnf".source = cfg.configFile;
# The mysql_install_db binary will try to adjust the permissions, but fail to do so with a permission
# denied error in some circumstances. Setting the permissions manually with tmpfiles is a workaround.
systemd.tmpfiles.rules = [
"d ${cfg.dataDir} 0755 ${cfg.user} ${cfg.group} - -"
];
systemd.services.mysql = {
description = "MySQL Server";