X-Git-Url: https://arthur.barton.de/gitweb/?p=MkMySqlDump.git;a=blobdiff_plain;f=bin%2Fmkmysqlslave;h=1804d8d83ef0241514f2f735d263202ee5920798;hp=fa60b93cd5c3957b25b6d4ade5d7301ea1e11046;hb=415475f697abd213f3d859162e1abeb5995d7ca7;hpb=4a9488518f4869d7f3d5ace07f4d9b744b6b55db diff --git a/bin/mkmysqlslave b/bin/mkmysqlslave index fa60b93..1804d8d 100755 --- a/bin/mkmysqlslave +++ b/bin/mkmysqlslave @@ -1,7 +1,7 @@ #!/bin/sh # # mkmysqlslave -- import MySQL master data and start slave -# Copyright (c)2015 Alexander Barton +# Copyright (c)2015-2016 Alexander Barton # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -87,11 +87,11 @@ fi echo "Start: $(date)" if [ "$INFILE" != "-" ]; then echo "Importing \"$INFILE\" ..." - mysql -h "$MYHOST" -u "$MYUSER" $PWSWITCH <"$INFILE"; r=$? else echo "Importing from standard input ..." - mysql -h "$MYHOST" -u "$MYUSER" $PWSWITCH; r=$? fi +( echo "SET SESSION SQL_LOG_BIN=0;"; cat "$INFILE" ) \ + | mysql -h "$MYHOST" -u "$MYUSER" $PWSWITCH; r=$? echo "End: $(date)" if [ $r -ne 0 ]; then echo "MySQL import FAILED, code $r!" >&2