- Instant help with your Sql coding problems

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]

Share "How to backup only selected tables in MySQL?"