wood burning stoves*
The moose likes JDBC and the fly likes Mysql data retrieving Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Mysql data retrieving" Watch "Mysql data retrieving" New topic
Author

Mysql data retrieving

ashish chakkara
Greenhorn

Joined: Sep 13, 2012
Posts: 10

Hi

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

Ashish
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

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
Greenhorn

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


Thanks
Ashish
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38481
    
  23
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
Bartender

Joined: Jun 19, 2010
Posts: 825
    
    5

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.
 
Consider Paul's rocket mass heater.
 
subject: Mysql data retrieving