File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Mysql data retrieving Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Mysql data retrieving" Watch "Mysql data retrieving" New topic

Mysql data retrieving

ashish chakkara

Joined: Sep 13, 2012
Posts: 10


I accidently updated my Mysql db with previous backup(which is 1 week old) just now.So i can't find the data entered yesterday.
Is there any way to get the db upto yesterday?

Please help me

Jeff Verdegan

Joined: Jan 03, 2004
Posts: 6109

Was your backup in the form of SQL statements to execute? Or did you just replace the data files with the older versions?

If it was done by SQL statements, then you may still have a transaction log around that you can use. I don't know the details, or even if you'll be able to fix it, but you could google for something like mysql transaction log or mysql recovery or something like that.

ashish chakkara

Joined: Sep 13, 2012
Posts: 10

Hi Jeff,

Thank you,

Actually my back is a .sql file which was taken by mysqldump command(mysqldump -u username -pPASSWORD pPASSWORD >/mnt/abc_23oct2012.sql)
This was done 1 week ago.Today i accidently run the command mysql -u username -pPASSWORD pPASSWORD < /mnt/abc_23oct2012.sql
So what happend is that i lost i week data from my db.So what should i do to recover the lost data? please help me...

Campbell Ritchie

Joined: Oct 13, 2005
Posts: 45415
You have already been given suggestions. What happened when you followed them?
I think this discussion would sit better in our databases fora: moving.
Kemal Sokolovic

Joined: Jun 19, 2010
Posts: 825

OP, try what other(s) already suggested. But I wouldn't be optimistic about retreiving old data since you didn't create a backup before you updated database. Since autocommit is enabled by default (source) all (create, update, delete) statements are commited as soon as they completed successfully, so I suppose there is no way to do a rollback.

The quieter you are, the more you are able to hear.
I agree. Here's the link:
subject: Mysql data retrieving
It's not a secret anymore!