Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass command line arguments to mysql scripts #1076

Merged
merged 2 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/modules/services/mysql.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
10 changes: 9 additions & 1 deletion tests/mysql/.test.sh
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions tests/mysql/devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@
};
};
};

scripts.ping-mysql.exec = ''
$DEVENV_PROFILE/bin/mysqladmin ping
'';
}
Loading