I have used mysqldump to dump an entire database,
However, when I want to use --where=condition"
, on individual tables, I have dumped individual tables
mysqldump --where='condition' mydb table > table.sql
and then reconstructed the database table by table
for i in *sql; do mysql newdb < i; done
Is it possible to use the where clause with mysqldump on specific tables when dumping an entire database?
Best Answer
You will have to custom script each table
The
--where
option is designed to help mysqldump a single tableHere is a post I made back in August 15, 2011
Is it possible to mysqldump a subset of a database required to reproduce a query?
Here is an crazy example
Suppose the table is this in the myworld database:
and you want to break it up into two dumps
You will need three files (one for the database schema, and two for the data)