- Instant help with your Sql coding problems

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!

Share "How to skip tables in MySQL backup?"