Jump to content


Photo

ROLLBACK Question


  • Please log in to reply
2 replies to this topic

#1 jbruns

jbruns
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 19 November 2003 - 07:25 PM

Hi there-
I accidently executed a mysql command \"DELETE FROM `responses` WHERE `obj_id` > 123. What I really meant to say was delete the row where obj_id = 123. Needless to say I delete ALL my data.

Fortunately I backup all my tables every night, however, this won\'t reflect anything that was input after 3am. I\'ve logged in as root and am looking at my tables under /var/lib/mysql/ and it considering the size of the file, I think the data is still there, although I can\'t access it.

I have 3 files:
res.frm --> 16396
res.MYD --> 544360
res.MYI --> 1389568

Judging by the size, I assume the data is still intact, however it\'s just a matter of retrieving it. I issued a ROLLBACK command, immediately after I made the deadly delete mistake, and it said it was executed successfully, however, it still reads as have 0 rows. Any suggestions?? Thanks!

#2 shivabharat

shivabharat
  • Members
  • PipPipPip
  • Advanced Member
  • 371 posts
  • LocationChennai, India

Posted 19 November 2003 - 09:42 PM

What MYSQL Says :?:

By default, MySQL runs in autocommit mode. This means that as soon as you execute an update, MySQL will store the update on disk.

If you are using transactions safe tables (like InnoDB, BDB, you can put MySQL into non-autocommit mode with the following command:


SET AUTOCOMMIT=0


So your Roll back will not be useful because you havent executed them as a transaction. If you have backed up tables try restoring them
Knowledge --- Reading Enriches Mind But Sharing Enhances It.[br][br]Note: Before you request help enusre that you have had a look at the tutorials @phpfreaks

#3 jbruns

jbruns
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 19 November 2003 - 09:57 PM

Yeah, that\'s what I figured, I just thought due to the size of the files, maybe there was some way to do it through a back door.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users