Skip to content
Snippets Groups Projects

#11148: skip dumping information|performance_schema in mysql handler

Closed #11148: skip dumping information|performance_schema in mysql handler
Closed louis requested to merge louis/backupninja:mysql into master
1 file
+ 6
15
Compare changes
  • Side-by-side
  • Inline
+ 6
15
@@ -96,7 +96,7 @@ then
fi
[ -d $home ] || fatal "Can't find root's home directory ($home)."
mycnf="$home/.my.cnf"
if [ $usevserver = yes ]
@@ -113,7 +113,7 @@ then
debug "mv $workcnf $tmpcnf"
mv $workcnf $tmpcnf
fi
oldmask=`umask`
umask 077
cat > $workcnf <<EOF
@@ -163,7 +163,7 @@ then
debug "User home set to: $userhome"
[ -f $userhome/.my.cnf ] || fatal "Can't find config file in $userhome/.my.cnf"
fi
defaultsfile="--defaults-extra-file=$userhome/.my.cnf"
debug "using $defaultsfile"
# otherwise use $configfile
@@ -238,14 +238,14 @@ then
then
if [ $usevserver = yes ]
then
debug 'set -o pipefail ; echo show databases | $VSERVER $vsname exec su $user -c \"$MYSQL $defaultsfile\" | grep -v Database'
databases=`set -o pipefail ; echo 'show databases' | $VSERVER $vsname exec su $user -c "$MYSQL $defaultsfile" | grep -v Database`
debug 'set -o pipefail ; echo show databases | $VSERVER $vsname exec su $user -c \"$MYSQL $defaultsfile\" | grep -v Database | grep -v '^\(information\|performance\)_schema$''
databases=`set -o pipefail ; echo 'show databases' | $VSERVER $vsname exec su $user -c "$MYSQL $defaultsfile" | grep -v Database | grep -v '^\(information\|performance\)_schema$'`
if [ $? -ne 0 ]
then
fatal "Authentication problem, maybe user/password is wrong or mysqld is not running?"
fi
else
databases=$(set -o pipefail ; su $user -c "$MYSQL $defaultsfile -N -B -e 'show databases'" | sed 's/|//g;/\+----/d')
databases=$(set -o pipefail ; su $user -c "$MYSQL $defaultsfile -N -B -e 'show databases'" | sed 's/|//g;/\+----/d;/^\(information\|performance\)_schema$/d')
if [ $? -ne 0 ]
then
fatal "Authentication problem, maybe user/password is wrong or mysqld is not running?"
@@ -257,15 +257,6 @@ then
do
DUMP_BASE="$MYSQLDUMP $defaultsfile $sqldumpoptions"
case "$db" in
information_schema)
DUMP_BASE="${DUMP_BASE} --skip-lock-tables"
;;
performance_schema)
DUMP_BASE="${DUMP_BASE} --skip-lock-tables --skip-events"
;;
esac
# Dumping structure and data
DUMP="$DUMP_BASE $ignore $db"
Loading