mysqlpump ทำ Logical Backup สร้าง SQL Statements เพื่อ Reproduce Database Objects และ Table Data
Features หลัก
- Parallel Processing Databases และ Objects -> เร็วกว่า
- ควบคุม Databases/Objects (Tables, Stored Programs, User Accounts) ที่จะ Dump ได้ละเอียด
- Dump User Accounts เป็น CREATE USER, GRANT Statements (แทน INSERT ลง mysql System DB)
- สร้าง Compressed Output ได้
- Progress Indicator (ประมาณการ)
- Faster Secondary Index Creation สำหรับ InnoDB (เพิ่ม Index หลัง Insert Rows)
ไวยากรณ์
# Dump ทุก Database shell> mysqlpump --all-databases # Dump Single Database shell> mysqlpump db_name # Dump Specific Tables shell> mysqlpump db_name tbl_name1 tbl_name2 ... # Treat All Arguments as Database Names shell> mysqlpump --databases db_name1 db_name2 ...
Reload Dump File
shell> mysqlpump [options] > dump.sql shell> mysql < dump.sql