Comments
Another tip - run mysql with --i-am-a-dummy (aka --safe-updates). If you're on Linux, you can even alias it:
alias safemysql=mysql --i-am-a-dummy
Ouch. However, we've all been there before. At least you learned this lesson on your own dataset, some admins at Danger could have used that lesson quite recently...
Um... LIMIT much?
you fucken loser!
one word... BACKUPS!
These things happen to the best of us, and your not alone by taking it easy with your own projects, as developers, we are all lazy.
It's in our nature :o
Doesn't MySQL have BEGIN TRANSACTION? Which you can then rollback?
If you use InnoDB, it's still possible to get data back.
You can check InnoDB recovery tool.
Are you turn on the binary log?
you can execute bin log from the backup time to delete statement.
It's easy
You're not alone! I recently very nearly lost my entire blog due to a server crash. I've now got more backups than I know what to do with. A bit daft really - only need a couple... :-/
Too bad that you have lost all your comments :(. Thanks for the reminder! As soon as I get home today I am going to write a backup script.
Check google cache: http://209.85.129.132/search?q=cache:LT42H3QFnacJ:www.rooftopsolutions.nl/article/253+http://www.rooftopsolutions.nl/article/253&cd=1&hl=de&ct=clnk&gl=de&client=firefox-a
What about using mysql tools that have "safe query" detection, like this: http://www.gosu.pl/dbkiss/ - see the screenshot and the feature "Error: Detected UPDATE/DELETE without WHERE condition ..."
Thanks for all the replies :)
I do have a binary log! Good point !
Now I need to find out how to rewind it, without affecting the new data..







