Backup only selected tables in MySQL
Question:
How to backup only selected tables in MySQL? Answer:
mysqldump -u testuser -p testdb --tables table1 table2 table3 > /tmp/backup_selected.sql
Description:
The --tables
attribute overrides the --databases
or -B
option. mysqldump
regards all name arguments following the option as table names.
Syntax: mysqldump -u [MYSQL_USER] -p [DATABASE_NAME] --tables [TABLE_NAME [TABLE_NAME]] > [OUTPUT_FILE]
Reference:
The --tables option reference
Share "How to backup only selected tables in MySQL?"
Related snippets:
- Import an SQL file using the command line in MySQL
- Backup only certain rows from MySQL database
- Create INSERT statement for each record with mysqldump
- Backup MySQL database without locking tables
- Backup MySQL data only
- Skip tables in MySQL backup
- Backup only selected tables in MySQL
- Backup MySQL schema only
- Backup MySQL database
Tags:
backup selected tables only, mysql export selected tables, mysql, backup, export, selected tables Technical term:
Backup only selected tables in MySQL