I have mysql [version 5.6] database dump file. I want to restore only one day data from that dump file.

Anyone has any clue ?

1 Answer 1


You have two alternatives:

1. Load the file into a new database table and do a query for the particular date that you want.


2. Hand edit the dump file and load that (also in a new database).

The second alternative has several disadvantages:

  • hand editing is unreliable and error prone.

  • you may break integrity constraints - not easy to see in a load of text!

  • it's a pain in the ass :-) and will probably take you more time than alternative 1.


Load the whole file - query the data you want,

CREATE my_table AS SELECT * FROM main_table
WHERE the_date = date_of_interest;

and then put that into a separate table, and then:

mysqldump db_name my_table > my_table.sql

Et voilà!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.