mysqldump with multiple tables with or without where clause
To dump multiple tables with multiple where conditions.
mysqldump -h <hostname> -u <username> -p'<password>' <db_name> <table_name> -where 'condition=true' --no-create-info > dumpfile.sql
Then, for second table, use ">>". It will append the previous dump file.
--no-create-info >> dumpfile.sql
mysqldump -h <hostname> -u <username> -p'<password>' <db_name> <table_name_2> -where 'condition=true' --no-create-info >> dumpfile.sql
make two dumps or if you dont want to make two dumps then try two command
a.
mysqldump -h<hostname> -u<username> -p
<databasename> <table1> <table2> <table3>
--single-transaction --no-create-info > dumpfile.sql
b.
mysqldump -h<hostname> -u<username> -p <databasename>
<table4> --where 'created > DATE_SUB(now(), INTERVAL 7 DAY)',
<table5> --where 'created > DATE_SUB(now(), INTERVAL 7 DAY)
--single-transaction --no-create-info >> dumpfile.sql
c.
gzip dumpfile.sql