We help IT Professionals succeed at work.

Undo upate command of mysql database

idOle
idOle asked
on
Medium Priority
452 Views
Last Modified: 2010-08-05
     
Hi there,        

I have accidentally updated my mysql table in all the rows, while my intension was just to update one row. I need help to undo the update command and get my old data back. Thanks a lot.
Comment
Watch Question

CERTIFIED EXPERT
Commented:
If you dont have a backup file somewhere I'm affraid you are out of luck.

Gamebits

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Top Expert 2006

Commented:
I agree with gamebits.  Hopefully, you have a backup.  This is also one reason to use transactional tables (InnoDB) and work with autocommit off - so you can rollback changes.  Sorry there's not a better answer.

Author

Commented:
Would you please tell me how to turn autocommit off, since I just change my table to type InnoDB. Thanks.
Top Expert 2006
Commented:
SET AUTOCOMMIT=0

There's some good information on transactions that you will want to read here:

http://dev.mysql.com/doc/refman/4.1/en/commit.html
Top Expert 2006

Commented:
Thanks for the points - sorry there isn't a better answer.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.