MYSQLDUMP with where condition and date range

I would like to take backup from a table for 6 months say in between date 1-july-2012 to 1-dec-2012 using mysqldump is it possible if yes please do let me know command.


mysqldump has a “where” parameter where you can specify what data you want to dump. _mysqldump_where

So to do that your table should have a column with a timestamp/datetime datatype that could allow you to write a where clause and thus dumping only the data you need. For example:

mysqldump database table_bame --where=“date_column BETWEEN ‘2012-07-01 00:00:00’ and ‘2012-12-01 00:00:00’”

This advice is still relevant and for MySQL 8.0  :stuck_out_tongue:
Updated manual page: 
Percona Server for MySQL offers extended functionality with mysqldump