From 737d89dbaee53888ce1499483ee0ed3d44444826 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 7 Aug 2019 10:25:00 +0200 Subject: re-bootstrap-slave-db new --- re-bootstrap-slave-db | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 re-bootstrap-slave-db (limited to 're-bootstrap-slave-db') diff --git a/re-bootstrap-slave-db b/re-bootstrap-slave-db new file mode 100755 index 0000000..cf44385 --- /dev/null +++ b/re-bootstrap-slave-db @@ -0,0 +1,19 @@ +#!/bin/bash + +if [ $# -ne 1 ] || [ ! -f "$1" ]; then + >&2 echo 're-bootstrap-slave-db $db-dump-file' + exit 1 +fi + +{ + printf 'STOP SLAVE;\n' + xzcat "${1}" + xzcat "${1}" \ + | sed -n ' + s/^-- CHANGE MASTER TO /CHANGE MASTER TO / + T + p + ' + printf 'START SLAVE;\n' +} \ +| mysql -u root -p -- cgit v1.2.3-70-g09d2