Respect user, host, and password when checking slave status
authorAlexander Barton <alex@barton.de>
Wed, 24 Feb 2016 00:10:42 +0000 (01:10 +0100)
committerAlexander Barton <alex@barton.de>
Wed, 24 Feb 2016 00:10:50 +0000 (01:10 +0100)
bin/mkmysqldump

index a470534b536c4bcfaee4afbf46affb051108741e..6ed980cdab1a2759b97ed0e66b5039e29dee2e6a 100755 (executable)
@@ -138,7 +138,7 @@ fi
 
 echo "Checking slave status ..."
 Slave_IO_Running=""; Slave_SQL_Running=""
-eval "$(echo 'SHOW SLAVE STATUS\G' | mysql | sed -n '/Running/p' | sed 's/: /=/g')"
+eval "$(echo 'SHOW SLAVE STATUS\G' | mysql -h "$MYHOST" -u "$MYUSER" $PWSWITCH | sed -n '/Running/p' | sed 's/: /=/g')"
 if [ -n "$Slave_IO_Running" -o -n "$Slave_SQL_Running" ]; then
        if [ "$Slave_IO_Running" = "Yes" -a "$Slave_SQL_Running" = "Yes" ]; then
                echo "Server is running as MySQL slave, replication is Ok."