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.

Hi,

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

http://dev.mysql.com/doc/refman/5.5/en/mysqldump.html#option _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: https://dev.mysql.com/doc/refman/8.0/en/mysqldump.html#option_mysqldump_where 
Percona Server for MySQL offers extended functionality with mysqldump 
https://www.percona.com/doc/percona-server/LATEST/flexibility/extended_mysqldump.html