News:

The anti-spam plugins have stopped being effective. Registration is back to requiring approval. After registering, you must ALSO email me with your username, so that I can manually approve your account.

Main Menu

my database vaporized

Started by Slang, October 19, 2007, 06:45:38 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Slang

Yeah. One of my databases has completely vanished.. every single table in it. I am very very pissed off.

Apparently it's happened twice now.. The first time however I never looked at the database to notice it.. I thought it was problems with my php scripts so I reinstalled them (and thus recreated database's tables)

But just today I noticed one of my pages/script was not working and had an error message (same as last time), and for some reason I decided to go into the database this time to check out a certain configuration..

and they're all gone. Ohhh you have no idea how mad I am right now. And confused! Does anyone have any possible idea what happened?
And for the record.. I never messed with any of the tables.. they've been running fine and so has my script for about a month now - just out of the blue I get the error, and the vanished tables.

and sadly no.. I don't have a backup.. I did not know those things just up and disappear. D=<

UGH lkdlfgnkjrnghkljfdg
"It is better to fail in originality than to succeed in imitation."
-Herman Melville

Databits

#1
If Xepher had cron scripts enabled I'd show you how to write a script to make a backup of your MySQL database. Unfortunately that won't help in the situation you're having at the current moment unless Xepher happens to have recent DB backups himself.

If you know how to use SSH or use shell access, I would also suggest doing a grep and looking through your php/sql files that exist to see what things would be calling stuff like "DELETE FROM ...", "TRUNCATE TABLE", or "DROP TABLE". Case insensitive search of course, because these commands aren't. Also, and this applies to EVERYONE here, make sure that when you install software like a forum you remove the setup files from the server after you've completed your installation.

Setup programs are well known for not being removed by the user and then coming back to haunt you later because some user decided to play with it, with or without malicious intent. Many new installations now days actually detect themselves after the installation is complete and tell you to remove them, but not all of them do this. I'm sure that comic software especially probably doesn't do this widely yet either.
(\_/)    ~Relakuyae D'Selemae
(o.O)    
(")_(")  [Libre Office] [Chrome]

Xepher

First off, you say "one of my databases" but each user only has ONE database. I'm going to guess you mean a subset of your tables vanished... e.g. all the ones used by a particular script. Can you tell me specifically what vanished, and what software/scripts were using it? Have you replaced the missing tables already? I see 47 tables in your DB, but many of them are mostly empty. Like Data mentioned, it's likely to be a leftover install script being triggered, and deleting them, or some similar glitch in a script. If the database fails, usually it corrupts a table. It'll respond as "not found" to scripts, but the database will still have the data and there's a chance to repair the table. Your DB has no corrupted tables at all, which is why I'm asking if you've already tried to restore/replace the tables. If you have, then I have no way of knowing if they were corrupted at first (then deleted/recreated by you or your scripts) or were directly dropped (truly "disappeared) in the first place. A lot of phpBB exploits are going around right now, and since phpBB would have access to the database, any hack that got in through that could potentially destroy anything in the database, even if it wasn't phpBB related tables. I think I saw a phpBB install in your folder, but I'm not sure.

On the subject of backups... I do have backups that are a few weeks old. (From before I went to India) I just don't have the disk space to make new backups for everyone all the time on the current server, as such, I only do it periodically. The problem is that I only have room for about one full backup... and if I did it every night, (for example) by the time you realize your data is missing/corrupt a few days later, I'd already have backed up the CORRUPT data. The new server will fix this (almost) entirely. It'll have a ton of storage space, and I've already got scripts written to automatically make a backup every night, AND keep old backups for a period of 6-8 weeks, thus as long as you bring it to my attention within a month or two, I'll be able to restore things and you'll never lose more than 24 hours of data maximum.

Try getting in touch with me on AIM (Xepher42) and we can work on restoring the backups I have for this. Databases are tricky, as I have to overwrite the current table storage files and restart the DB server to restore things. As such, I need to know exactly what I should be looking for/at to restore, to make sure I don't acidently overwrite anything else. It's easier to coordinate via AIM, since it's a lot quicker back-and-forth than the forum or email. If you don't see me online when you are though, go ahead and respond here and we can work through it a tad slower.

Slang

The install files had been deleted I'm quite sure.
I'm not concerned about restoring them at this point, but thank you very much Xeph. I'm already researchin' different things to use instead of what I was doing previously.
( I basically gave up on it :\ )

Quotebut each user only has ONE database.
phpmyadmin, under databases.. has two writable things for me. tripout(47) and test(54). Looks like two to me? I dunno, I'm relatively new to the database system, still figuring it out.
"It is better to fail in originality than to succeed in imitation."
-Herman Melville

Xepher

Okay, true... but the "test" database is writable by EVERYONE. As the name implies, it's only for testing purposes. If you had put anything there, it could've been deleted by anyone or anything. Additionally, I believe the test database is cleared out every time the SQL server restarts. Was that where your stuff was that disappeared? If so, that would certainly explain it.

Slang

Yep. That explains it lol I had a feeling it was something like that. I'm retarded.
I replaced my personal database with what I needed.

Thanks Xeph :P
"It is better to fail in originality than to succeed in imitation."
-Herman Melville

Xepher

#6
Well, I'm glad it was just a mistake, and not something wrong with the system. Still, sorry you lost your data.

Note to self: Make very clear instructions for people to NOT use the test database for anything important. (Also, see if it can be disabled.)

EDIT: I've deleted the test database entirely, so people shouldn't be confused by that in the future.