PDA

View Full Version : NEED the database records back!


Kore
01-24-2002, 12:45 AM
I've just made a 'huge-little' mistake. A php page I was creating kept giving parsing errors, so I would change something, save, upload, test, over and over. Well I got rid of the parsing errors and the page loaded up. An entry-modifying page. I type in a bit of stuff to modify an entry, hit Submit, and ALL OF THE RECORDS IN THAT TABLE were overwritten with what I had just entered! That was my reports table which held many lengthy news articles - GONE in the blink of an eye. =[ Turns out it slipped my mind to add "WHERE id='$id'" at the end of my UPDATE statement, therefore all the records were overwritten with the same thing.

I've been looking around the forum and found some posts saying that HostRocket does NOT backup database content! I never even thought to back it up myself because my previous 6-dollar host backs up the content every single day for you. Can HostRocket restore a backup of my table or database? I really hope so, else I think I'll just give up on this news site. 5 months of articles were stored in that table.

Thanks for any help with this, and sorry for the stupid mistake.

Kore
01-24-2002, 01:19 AM
I ran a search on my computer for files containing a certain phrase I knew was in one of the records, and LO AND BEHOLD after a long search - thank God for sql(1).tmp!

Good thing I never rebooted, but I would still like to know if HostRocket does backups of database content on our behalf. If not, I would strongly suggest that they notify new account holders of that fact - I took it for granted that they do.

tbj
01-24-2002, 08:13 AM
Use a crontab job to dump it into your account space and it will be included in your daily backup.

Just last week I had a table containing log-in information that became corrupted. I deleted the table and recreated & reloaded it from the back up (total of about 15 seconds). It took longer to figure out what the problem was than it did to fix it.

JoeF
01-24-2002, 09:21 PM
mysqldump -u yourdb_user -p your_dbname --add-locks --add-drop-table > ~/database.backup

Kore
02-03-2002, 03:38 AM
I'll try that, thanks guys!