diff --git a/env/mysql.nix b/env/mysql.nix index e7adb56..0ed93fb 100644 --- a/env/mysql.nix +++ b/env/mysql.nix @@ -12,9 +12,12 @@ in mkShell { shellHook = '' trap "kill 0" EXIT - [ -d ${data_dir} ] || mkdir ${data_dir} - mysqld --datadir="${data_dir}" --socket="${socket}" --initialize-insecure + + if [ ! -d ${data_dir} ]; then + mysqld --datadir="${data_dir}" --socket="${socket}" --initialize-insecure + fi + mysqld --datadir="${data_dir}" --socket="${socket}" --skip-networking --skip-mysqlx & sleep 1