diff --git a/src/modules/services/mysql.nix b/src/modules/services/mysql.nix index fdaae7977..32e99bf0c 100644 --- a/src/modules/services/mysql.nix +++ b/src/modules/services/mysql.nix @@ -293,11 +293,17 @@ in MYSQL_TCP_PORT = toString cfg.settings.mysqld.port; }); - scripts.mysql.exec = "${mysqlWrapped}/bin/mysql"; + scripts.mysql.exec = '' + ${mysqlWrapped}/bin/mysql "$@" + ''; - scripts.mysqladmin.exec = "${mysqladminWrapped}/bin/mysqladmin"; + scripts.mysqladmin.exec = '' + ${mysqladminWrapped}/bin/mysqladmin "$@" + ''; - scripts.mysqldump.exec = "${mysqldumpWrapped}/bin/mysqldump"; + scripts.mysqldump.exec = '' + ${mysqldumpWrapped}/bin/mysqldump "$@" + ''; processes.mysql.exec = "${startScript}/bin/start-mysql"; processes.mysql-configure.exec = "${configureScript}/bin/configure-mysql"; diff --git a/tests/mysql/.test.sh b/tests/mysql/.test.sh index 29693a293..3717109e5 100755 --- a/tests/mysql/.test.sh +++ b/tests/mysql/.test.sh @@ -1,6 +1,14 @@ +set -e + wait_for_port 3306 + +# Wait for configure-mysql to finish. +sleep 5 + # through unix_socket mysql -e 'SELECT VERSION()' # through tcp/ip -mysql -h 127.0.0.1 -udb -pdb -e 'SELECT VERSION()' +mysql -h "127.0.0.1" -udb -pdb -e 'SELECT VERSION()' + +ping-mysql diff --git a/tests/mysql/devenv.nix b/tests/mysql/devenv.nix index 3c2e4bbe9..0ca449eb7 100644 --- a/tests/mysql/devenv.nix +++ b/tests/mysql/devenv.nix @@ -16,4 +16,8 @@ }; }; }; + + scripts.ping-mysql.exec = '' + $DEVENV_PROFILE/bin/mysqladmin ping + ''; }