Last active
August 5, 2023 13:58
-
-
Save MichalSkoula/0bd16693e9c48b985a98dd54810cb7ff to your computer and use it in GitHub Desktop.
extract mbstream backup using mariadb's mbstream utility + restore database files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# use integrated docker terminal or run bash like this: | |
docker exec -it CONTAINERID /bin/bash | |
# unzip and then use mbstream utility to extract data | |
cd /var/www/html/dbbackup/; | |
gunzip -c DB.gz | mbstream -x; | |
# restore db | |
cd /var/lib/mysql; | |
rm -r *; | |
mariabackup --prepare --target-dir=/var/www/html/dbbackup; | |
mariabackup --copy-back --target-dir=/var/www/html/dbbackup; | |
chown -R mysql:mysql /var/lib/mysql/; | |
# (restart docker container) | |
# login as root to mysql | |
# then allow login from everywhere | |
GRANT ALL ON *.* to UZIVATEL@'%' IDENTIFIED BY 'HESLO'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://mariadb.com/kb/en/full-backup-and-restore-with-mariabackup/