Skip tables in MySQL backup
Question:
How to skip tables in MySQL backup? Answer:
mysqldump -u testuser -p testdb --ignore-table testdb.table1 --ignore-table testdb.table2 > /tmp/backup_ignored.sql
Description:
You can ignore one or more tables during MySQL backup with the--ignore-table
option.
The option forces mysqldump
to do not dump the given table, which must be specified using both the database and table names. To ignore multiple tables, use this option multiple times. This option also can be used to ignore views.
For each table, you want to ignore, you need to prefix the table with the database name!
Reference:
The --ignore-table option reference
Share "How to skip tables in MySQL backup?"
Related snippets:
Tags:
skip tables from backup, ignore tables in backup, mysqldump ignore tables, dump Technical term:
Skip tables in MySQL backup