Lab 19: Backup & Restore
Step 1 — MySQL: mysqldump Basics
# Full database dump (single database)
docker exec mysql-lab8 mysqldump \
-uroot -prootpass \
--single-transaction \
--routines \
--triggers \
labdb > /tmp/labdb_backup.sql
# Verify backup
wc -l /tmp/labdb_backup.sql
head -30 /tmp/labdb_backup.sql168 /tmp/labdb_backup.sql
-- MySQL dump 10.13 Distrib 8.0.45, for Linux (x86_64)
-- Host: localhost Database: labdb
-- Server version 8.0.45
...
CREATE TABLE `orders` (
`id` int NOT NULL AUTO_INCREMENT,
`customer` varchar(100) DEFAULT NULL,
...Step 2 — MySQL: Backup Options
Step 3 — MySQL: Restore from Dump
Step 4 — MySQL: Binary Log and Point-in-Time Recovery
Step 5 — PostgreSQL: pg_dump
Step 6 — PostgreSQL: pg_restore and pg_dumpall
Step 7 — PostgreSQL: Point-in-Time Recovery Concept
Step 8 — MongoDB: mongodump and mongorestore
Summary
Tool
Database
Format
Use Case
Last updated
