Connecting Tech Pros Worldwide Forums | Help | Site Map

Big mistake: Update command without where clause

Member
 
Join Date: Sep 2007
Posts: 97
#1: Oct 20 '08
Hi,

Can anyone help me to recover or undo this problem?

I did inadvertently run a command, 'update ..set' without where clause and changed every records. Unfortunately our backup didn't run last night.

Is there any way to recover or undo this? Please help me....

Member
 
Join Date: Sep 2007
Posts: 97
#2: Oct 20 '08

re: Big mistake: Update command without where clause


I forgot to add some info:

I am using MySQL 5.0
Table type is MyISAM
mwasif's Avatar
Moderator
 
Join Date: Jul 2006
Location: Pakistan
Posts: 719
#3: Oct 21 '08

re: Big mistake: Update command without where clause


You can not undo this operation AFAIK except you have backup.
dlite922's Avatar
Expert
 
Join Date: Dec 2007
Location: Moon, Dark Side
Posts: 1,095
#4: Oct 21 '08

re: Big mistake: Update command without where clause


To my knowledge, there is no way to undo. This should be a lesson learned.

Learn to backup or session your changes (Using BEGIN, ROLLBACK, and COMMIT commands) or just make a habit of dumping the database before logging into it.

Never do it again is the only advice at this point I guess. Sorry it's not much help.




Dan
Member
 
Join Date: Sep 2007
Posts: 97
#5: Oct 21 '08

re: Big mistake: Update command without where clause


I was able to put them back fortunately!
Yesterday I was so frantic/insane enough unable to remember that I had some tags to identify certain records. Big chunk of records are now back by those tags. Thank god!
In fact we had our departmental on-line backup, which coincidently was not running for last couple of days due to changing backup nod.

Definitely this experience is now valuable lesson to me, not to rely on other backup but to have a habit to backup of my own.

Thank you so much for your replies!
Whew~~~~!
Reply