Ever do something really dumb?

Started by TehBorken, Jan 14 07 08:06

Previous topic - Next topic

TehBorken

  Ever do something really dumb? I mean reeeeeeeeeeeeeally dumb? I did.  

I'm working on a web site today, and it has a big ol' complex database with lots of tables. They hold thousands and thousands of bits of data (names, ages, email addresses, configuration settings, etc) About 1.5 million different bits of data actually. Now there's one really critical table that holds a whole bunch of info that ties to other tables. In fact, it ties into just about all of the other tables and all the other tables tie into it. It's like the central table that stores all the stuff that alll the other parts of the program use to look up where to find the stuff they need.

Well....Captain Brilliant (that's me) wanted to use this main table as a template to build a smaller, less complex table from. The main table has like 30 columns but I only needed the first 4 columns from it, so I copied the main table's structure (but not the data) to a new table name. Then I took the new table and dropped (removed) all but the 4 columns I needed.

Then I noticed that I was still working in the main table.   Yep...it all went bye-bye. By the way, there's no "undo" in the mySQL database. When it's gone, it's gone. For good. No gettin' it back, no way, no how. Gone as in "Elvis has left the building" gone. Gone as in a "puppy through a woodchipper" gone.

Yeah, the sweat popped out on my forehead like Niagra F*cking Falls. Did I mention that this was a live, active site with users running around all over the place doing stuff? Yeah, it was. Until I got there, anyway. lol

I had a backup file that was several days old (thank you, Lord), but a lot has happened in the last several days. I managed to get most of it back, then spent a couple of frantic hours bringing it back to more or less the state it was in before I cleverly screwed the livin' shit out of it. There are still a few minor things out of whack, but not too bad. Why, you'd *cough* hardly notice. lol

So I earned my "F*ckTard Merit Badge" today. Now I think I'm gonna go lay down for a while.

     
The real trouble with reality is that there's no background music.

purelife

 Uhhm, you lost me at paragraph one about tieing tables.    
 
 ADD:  I'll bless you anyways.  :)
   

kingy

gotta love hosting websites. i killed my hosting server one time. longest day of my life.
...

Russ

I kinda get what you did.. I had to use Mr Google for some of it, but I learn every time I read something like this from you. I thought that when theres something like this, that it takes an automatic backup everyday?
Mercy to the Guilty is Torture to the Victims

Sportsdude

I have no idea what you are talking about but I have done a lot of dumb things over my short life so far.
"We can't stop here. This is bat country."

P.C.

I only understand a little of what you experience......well actually I understood nothing, except the losing stuff part.....and the 1.5 million part.  I'm SO sorry TehBorken.  That would definitely make the hairs on the back of your neck prickle when you realized what you'd done.  [img style="CURSOR: pointer" onclick=url(this.src); src="vny!://www.cheesebuerger.de/images/smilie/liebe/d038.gif" border=0]    
Sir Isaac Newton invented the swinging door....for the convenience of his cat.

P.C.

Would this be a bad time to ask you why it takes me 5 minutes to post a reply ?  [img style="CURSOR: pointer" onclick=url(this.src); src="vny!://www.cheesebuerger.de/images/more/bigs/c007.gif" border=0]
Sir Isaac Newton invented the swinging door....for the convenience of his cat.

TehBorken

 Russ wrote:
I thought that when theres something like this, that it takes an automatic backup everyday?

Ah, ha ha ha ha, no.

When you drop tables or columns in a mySQL database, they're gone forever. "Puppy through the woodchipper" is how it's described.

 
The real trouble with reality is that there's no background music.

TehBorken

 P.C. wrote:
  That would definitely make the hairs on the back of your neck prickle when you realized what you'd done.

The hairs on the back of my neck stood up, turned white, and fell out.
 
The real trouble with reality is that there's no background music.

Russ


Russ wrote:
 [SPAN style="FONT-STYLE: italic"]I thought that when theres something like this, that it takes an automatic backup everyday?[/SPAN][BR style="FONT-STYLE: italic"]TehBorken wrote:
Ah, ha ha ha ha, no.

When you drop tables or columns in a mySQL database, they're gone forever. "Puppy through the woodchipper" is how it's described.

[/DIV]

 Oh, so just to make this simpler for my little mind, you were messing with the main program that would normally handle the daily backups then? The Framework of the operating system so to speak? I thought that you needed a program to edit that program, and it would take an automatic 'snapshot' or backup...

  But it doesnt. Hmm. Is there a program that does?
Mercy to the Guilty is Torture to the Victims

TehBorken

      Russ wrote:
 Oh, so just to make this simpler for my little mind, you were messing with the main program that would normally handle the daily backups then?

No, not the program, but the data that the program needs to use. Think of the database like a phone book...it holds all the names and numbers, organized so you can find them easily according to some logic (they're arranged alphabetically). Each entry has a name, a number, an address, and so on.

Now imagine you tear all the pages out of the phone book leaving just the covers. That's basically what I did.


The Framework of the operating system so to speak? I thought that you needed a program to edit that program, and it would take an automatic 'snapshot' or backup... [/div]
No, it's not the program, it the data the program uses, the actual information. If you had a web-based phone book there would be a database with all the names, numbers, addresses, etc. That's the information, the data.

You use a program to look into the database for you so you can find the data you want (the name and number). If there are no names and numbers to find, things go pear-shaped pretty quickly. But if there's not even a phone book there, it's even worse.

It all just crashes in a most ungraceful way, and it spits out lots of interesting and scary error messages. "[span style="font-family: Courier New; font-weight: bold;"]No table found[/span]", "[span style="font-family: Courier New; font-weight: bold;"]Invalid column in WHERE statement[/span]", "[span style="font-family: Courier New;"]$user_id is not a valid mySQL resourc[/span][span style="font-family: Courier New; font-weight: bold;"]e[/span]"....all these things are very, very bad. They all translate roughly to "[span style="font-family: Courier New; font-weight: bold;"]You're In Deep Shit[/span]".


 [div style="font-style: italic;"]But it doesnt. Hmm. Is there a program that does?
 There is now, lol. I'm doing daily (sometimes hourly) backups of the whole database.
 
The real trouble with reality is that there's no background music.

Russ

thanks TB.. I think I get it.    
Mercy to the Guilty is Torture to the Victims