I recently had a table crash. All the data (400K of carefully picked up data like monument descriptions, timetables, addresses, phones and so on) vanished in the air.
Of course I should have made regular backups. Sometimes I do. Generally I make a routine to do it for me while I sleep. But I didn't this once.
I was advised to drop the crashed table and reload it again. However, I thought that could be a little too radical too start with.
So I went to mysql.com, Documentation, searched for crash.
One suggestion only: use REPAIR TABLE <tablename>
So I did. I wrote a small php script:
mysql_connect(your data)
$query="repair table monuments";
$res=mysql_query($query);
echo $res;
I ran the script and got an OK page.
At first I thought it was to quick, too easy, but then I went to see and yes, the table was there, in all its glory, there's probably a corrupt record somewhere, but I didn't find it yet.
Hope this helps someone...


LinkBack URL
About LinkBacks



Reply With Quote

Bookmarks