Install and Use dbsake for MySQL Recovery
dbsake is a collection of command-line tools for MySQL DBA tasks, including recovering table structures from .frm files and creating sandboxed MySQL instances for testing recovery.
Install dbsake
curl -s http://get.dbsake.net > /usr/bin/dbsake
chmod u+x /usr/bin/dbsakeNote: dbsake requires Python 3.9. It does not work with Python 3.10+.
Install Dependencies
apt-get install libaio1 libaio-dev libncurses5Create a Sandbox Instance (MySQL 5.7)
dbsake sandbox \
--sandbox-directory=/opt/mysql-5.7.31 \
--datadir=/root/mysqlCreate a Sandbox (MariaDB from tarball)
# Download the MariaDB binary tarball
wget https://archive.mariadb.org/mariadb-10.6.15/bintar-linux-systemd-x86_64/mariadb-10.6.15-linux-systemd-x86_64.tar.gz
# Create sandbox
dbsake sandbox \
--sandbox-directory=/root/ezfood-sandbox \
--mysql-distribution=/root/mariadb-10.6.15-linux-systemd-x86_64.tar.gz \
--datadir=/root/ezfood-mysql/mysqlStart the Sandbox
/opt/mysql-5.7.31/startNotes
- Full documentation:
https://dbsake.readthedocs.io/en/latest/ - The sandbox is a self-contained MySQL instance useful for recovering data without touching production.