preStart = ''
if ! test -e ${dataDir}/mysql; then
- ${hcfg.package}/bin/mysqldump \
- --defaults-file=${config.secrets.location}/mysql_replication/${name}/mysqldump_remote \
- -h ${hcfg.host} \
- -P ${hcfg.port} \
- --ssl \
- --gtid \
- --flush-privileges \
- --master-data \
- --all-databases > ${dataDir}/initial.sql
+ if ! test -e ${dataDir}/initial.sql; then
+ ${hcfg.package}/bin/mysqldump \
+ --defaults-file=${config.secrets.location}/mysql_replication/${name}/mysqldump_remote \
+ -h ${hcfg.host} \
+ -P ${hcfg.port} \
+ --ssl \
+ --gtid \
+ --flush-privileges \
+ --master-data \
+ --all-databases > ${dataDir}/initial.sql
+ fi
${hcfg.package}/bin/mysql_install_db \
--defaults-file=/etc/mysql/${name}_my.cnf \
let
sql_before = pkgs.writeText "mysql-initial-before" ''
DROP DATABASE test;
+ INSTALL SONAME 'auth_pam';
'';
setupScript = pkgs.writeScript "mysql-setup" ''
#!${pkgs.runtimeShell} -e