mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-14 21:49:34 +03:00
nixos/mysql: fix init databases on first start in sandbox mode
This commit is contained in:
parent
a9d5f088b5
commit
eed170d9ab
1 changed files with 3 additions and 3 deletions
|
@ -358,12 +358,12 @@ in
|
||||||
preStart = if isMariaDB then ''
|
preStart = if isMariaDB then ''
|
||||||
if ! test -e ${cfg.dataDir}/mysql; then
|
if ! test -e ${cfg.dataDir}/mysql; then
|
||||||
${mysql}/bin/mysql_install_db --defaults-file=/etc/my.cnf ${mysqldOptions}
|
${mysql}/bin/mysql_install_db --defaults-file=/etc/my.cnf ${mysqldOptions}
|
||||||
touch /tmp/mysql_init
|
touch ${cfg.dataDir}/mysql_init
|
||||||
fi
|
fi
|
||||||
'' else ''
|
'' else ''
|
||||||
if ! test -e ${cfg.dataDir}/mysql; then
|
if ! test -e ${cfg.dataDir}/mysql; then
|
||||||
${mysql}/bin/mysqld --defaults-file=/etc/my.cnf ${mysqldOptions} --initialize-insecure
|
${mysql}/bin/mysqld --defaults-file=/etc/my.cnf ${mysqldOptions} --initialize-insecure
|
||||||
touch /tmp/mysql_init
|
touch ${cfg.dataDir}/mysql_init
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -395,7 +395,7 @@ in
|
||||||
done
|
done
|
||||||
''}
|
''}
|
||||||
|
|
||||||
if [ -f /tmp/mysql_init ]
|
if [ -f ${cfg.dataDir}/mysql_init ]
|
||||||
then
|
then
|
||||||
${concatMapStrings (database: ''
|
${concatMapStrings (database: ''
|
||||||
# Create initial databases
|
# Create initial databases
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue