[metactl.post-start] restore without specifying database [metactl.pre-stop] backup with --flush-privileges

This commit is contained in:
xdrm-brackets 2018-03-21 00:11:11 +01:00
parent 8b3466249c
commit 728f4f3e71
2 changed files with 2 additions and 2 deletions

View File

@ -46,7 +46,7 @@ if [ "$DUMP_FILE_EXISTS" = "0" ]; then
# Restore mariadb database
echo -ne " * Restore database..........";
cat $MARIADB_DUMP | docker exec -i $MARIADB_SERVICE mysql -uroot -p$MARIADB_ROOT_PASSWORD $MARIADB_DATABASE_NAME 2>/dev/null && echo "restored" || echo "failed";
cat $MARIADB_DUMP | docker exec -i $MARIADB_SERVICE mysql -uroot -p$MARIADB_ROOT_PASSWORD 2>/dev/null && echo "restored" || echo "failed";
else

View File

@ -15,5 +15,5 @@ test ! -d $ROOT/persistent && mkdir -p $ROOT/persistent;
# 2. Backup database
echo -ne " * Backup database...........";
docker exec $MARIADB_SERVICE mysqldump --all-databases -uroot -p$MARIADB_ROOT_PASSWORD > $MARIADB_DUMP;
docker exec $MARIADB_SERVICE mysqldump --all-databases --flush-privileges -uroot -p$MARIADB_ROOT_PASSWORD > $MARIADB_DUMP;
test "$?" = "0" && echo "done" || (echo "failed"; exit 1);