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:
- 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:
skip tables from backup, ignore tables in backup, mysqldump ignore tables, dump Technical term:
Skip tables in MySQL backup