mysqldump skip one table
- by danneth
I'm running a cronjob to backup our system using mysqldump. The database contains 90 or so tables. One of these tables is HUGE and every once in a while causes the dump to fail.
From the manual I see that you can specify specific tables to dump
shell> mysqldump [options] db_name [tbl_name ...]
This got me thinking. What if I have two jobs, one for dumping the huge table, and one for all the others. To accomplish this it would be nice if I could to something like
shell> mysqldump -u backupuser -p database huge_table > db_huge_table.sql
shell> mysqldump -u backupuser -p database --skip huge_table > db_rest.sql
Unfortenately I'm not seeing such and option. I could of course explicitly state the 90 tables, but that just seems like a mess.
Another option would be a script of some sort, but before checking that route I'll try this resource.
MySQL is 5.1.61 on CentOS 6.2