Doing it that way will rape disk I/O on your server, much better use ZFS snapshot
then just zfs send & pipe thru xz/bzip2 to send it remotely
Example:
#!/bin/bash
TS=$(date "+%Y%m%d-%H%M%S")
SNAP=zpool/mysql@${TS}
zfs snapshot $SNAP
zfs send $SNAP | pv | xz -z | ssh somewhere "cat > /mnt/snapshots/mysql-${TS}.xz"
zfs destroy -Rv $SNAP
Assumes that your /var/lib/mysql is zpool/mysql ofc