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 ?
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.Sign up to join this community
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).
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