NOOOOOOOOOOOOO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I can’t beleive I just did that….

I was trying to fix messed up record in our in-house MySQL database. I ran an update command and forgot use a where clause to specify the id of the record I was trying to fix. MySQL very happily went along and made the change to every rocord in the database.

Long story short, I fixed the record – and messed up 16389 others.

DAMNIT!

I’m waiting for a call back from the resident DB guru to see if he can help me fix this.

Man, this is bad.

Published by

Robert

Robert Belknap has been writing online sporadically since 2001. See the colophon for more details.

5 thoughts on “NOOOOOOOOOOOOO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!”

  1. DB-guru to the rescue!

    It seems I’m not the first person to do something similar to our DB, and my change was less damagng than it could have been. The DB has been repaired.

    –i-am-a-dummy will become my new friend.

  2. That’s the joy/danger of really powerful tools. One miskey, and you suddenly wish you had a “do-what-I-wanted-not-what-I-just-said” button.

  3. @2 – yep. There was a fraction of a second when I went, gee – that took longer than it should of… then I saw the number of records changed and I freaked. double-checked the web interface – freaked some more, looked back at my shell prompt to figure out what went wrong – continuted freaking, then called for help and told the people in the lab to not start any new jobs becuase I had f-ed up the database. Then wrote my blog entry… and freaked.

    @3 yes, sort of – if you have a recent backup/know how to replay sql log files.

    The last full-backup we had was from Thursday. (My dumb luck that Friday’s backup didn’t happen because of network changes.) So the Guru restored from that backup, and then (I think) played forward the sql log up until the point where I goofed. Then we took a look at the tables to see if there were any other tweaks that needed to be done to get DB consistant with reality.

    (oh and btw – the shirt you got Justin is cute, but the program wouldn’t compile. I think you’re missing a semi-colon :p)

Leave a Reply

Your email address will not be published.