Loading nixos/modules/services/databases/mysql.nix +5 −5 Original line number Diff line number Diff line Loading @@ -469,7 +469,7 @@ in ( echo 'CREATE DATABASE IF NOT EXISTS `${database.name}`;' ${lib.optionalString (database.schema != null) '' echo 'use `${database.name}`;' echo 'USE `${database.name}`;' # TODO: this silently falls through if database.schema does not exist, # we should catch this somehow and exit, but can't do it here because we're in a subshell. Loading @@ -488,7 +488,7 @@ in ${lib.optionalString (cfg.replication.role == "master") '' # Set up the replication master ( echo "use mysql;" ( echo "USE mysql;" echo "CREATE USER '${cfg.replication.masterUser}'@'${cfg.replication.slaveHost}' IDENTIFIED WITH mysql_native_password;" echo "SET PASSWORD FOR '${cfg.replication.masterUser}'@'${cfg.replication.slaveHost}' = PASSWORD('${cfg.replication.masterPassword}');" echo "GRANT REPLICATION SLAVE ON *.* TO '${cfg.replication.masterUser}'@'${cfg.replication.slaveHost}';" Loading @@ -498,9 +498,9 @@ in ${lib.optionalString (cfg.replication.role == "slave") '' # Set up the replication slave ( echo "stop slave;" echo "change master to master_host='${cfg.replication.masterHost}', master_user='${cfg.replication.masterUser}', master_password='${cfg.replication.masterPassword}';" echo "start slave;" ( echo "STOP SLAVE;" echo "CHANGE MASTER TO MASTER_HOST='${cfg.replication.masterHost}', MASTER_USER='${cfg.replication.masterUser}', MASTER_PASSWORD='${cfg.replication.masterPassword}';" echo "START SLAVE;" ) | ${cfg.package}/bin/mysql -u ${superUser} -N ''} Loading Loading
nixos/modules/services/databases/mysql.nix +5 −5 Original line number Diff line number Diff line Loading @@ -469,7 +469,7 @@ in ( echo 'CREATE DATABASE IF NOT EXISTS `${database.name}`;' ${lib.optionalString (database.schema != null) '' echo 'use `${database.name}`;' echo 'USE `${database.name}`;' # TODO: this silently falls through if database.schema does not exist, # we should catch this somehow and exit, but can't do it here because we're in a subshell. Loading @@ -488,7 +488,7 @@ in ${lib.optionalString (cfg.replication.role == "master") '' # Set up the replication master ( echo "use mysql;" ( echo "USE mysql;" echo "CREATE USER '${cfg.replication.masterUser}'@'${cfg.replication.slaveHost}' IDENTIFIED WITH mysql_native_password;" echo "SET PASSWORD FOR '${cfg.replication.masterUser}'@'${cfg.replication.slaveHost}' = PASSWORD('${cfg.replication.masterPassword}');" echo "GRANT REPLICATION SLAVE ON *.* TO '${cfg.replication.masterUser}'@'${cfg.replication.slaveHost}';" Loading @@ -498,9 +498,9 @@ in ${lib.optionalString (cfg.replication.role == "slave") '' # Set up the replication slave ( echo "stop slave;" echo "change master to master_host='${cfg.replication.masterHost}', master_user='${cfg.replication.masterUser}', master_password='${cfg.replication.masterPassword}';" echo "start slave;" ( echo "STOP SLAVE;" echo "CHANGE MASTER TO MASTER_HOST='${cfg.replication.masterHost}', MASTER_USER='${cfg.replication.masterUser}', MASTER_PASSWORD='${cfg.replication.masterPassword}';" echo "START SLAVE;" ) | ${cfg.package}/bin/mysql -u ${superUser} -N ''} Loading