Exclude tables from mysqldump

Filed under database, linux, programming, and quickie.

Recently I was in a position where i wanted to exclude 2 large tables from mysqldump, without specifying every single table I wanted to back up. After a bit of searching, it seems you can easily exclude tables from mysqldump using the —ignore-table option :

> mysqldump -u dave -ppassword -h localhost --ignore-table=my_db_name.my_table_name my_db_name 

obviously substituting your own username, password, db name and table name etc . As far as i can tell you can use this option multiple times to exclude multiple tables


If you enjoyed this post, please follow us on twitter or subscribe to our feed!