Skip to content

Instantly share code, notes, and snippets.

@MichalSkoula
Last active August 5, 2023 13:58
Show Gist options
  • Save MichalSkoula/0bd16693e9c48b985a98dd54810cb7ff to your computer and use it in GitHub Desktop.
Save MichalSkoula/0bd16693e9c48b985a98dd54810cb7ff to your computer and use it in GitHub Desktop.
extract mbstream backup using mariadb's mbstream utility + restore database files
# 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';
@MichalSkoula
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment