Announcement

Announcement Module
Collapse
No announcement yet.

MYSQLDUMP with where condition and date range

Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.

  • #2
    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'"

    Comment

    Working...
    X