Merge pull request #64199 from thorstenweber83/fix-mysql-test

nixos/mysql: fix mysql test after #63862
This commit is contained in:
Aaron Andersen 2019-07-03 06:27:40 -04:00 committed by GitHub
commit 9f2518da59
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View file

@ -319,7 +319,9 @@ in
ExecStart = "${mysql}/bin/mysqld --defaults-file=/etc/my.cnf ${mysqldOptions} $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION";
ExecStartPost =
let
setupScript = pkgs.writeShellScript "mysql-setup" ''
setupScript = pkgs.writeScript "mysql-setup" ''
#!${pkgs.runtimeShell} -e
${optionalString (!hasNotify) ''
# Wait until the MySQL server is available for use
count=0

View file

@ -29,10 +29,10 @@ import ./make-test.nix ({ pkgs, ...} : {
users.users.testuser = { };
services.mysql.enable = true;
services.mysql.initialScript = pkgs.writeText "mariadb-init.sql" ''
echo "ALTER USER root@localhost IDENTIFIED WITH unix_socket;"
echo "DELETE FROM mysql.user WHERE password = ''' AND plugin = ''';"
echo "DELETE FROM mysql.user WHERE user = ''';"
echo "FLUSH PRIVILEGES;"
ALTER USER root@localhost IDENTIFIED WITH unix_socket;
DELETE FROM mysql.user WHERE password = ''' AND plugin = ''';
DELETE FROM mysql.user WHERE user = ''';
FLUSH PRIVILEGES;
'';
services.mysql.ensureDatabases = [ "testdb" ];
services.mysql.ensureUsers = [{