PDA

View Full Version : Corrupted post table!


Head-Nod.com
01-20-2011, 02:39 PM
Hello, my post table is totally corrupted. :eek:

It should have many thousands of entries, and it shows 0.

"Repair / Optimize Tables" failes with the following errors:

Warning: Table is marked as crashed and last repair failed
Warning: Size of indexfile is: 5221376 Should be: 1024
Error: Record-count is not ok; is 511476 Should be: 0
Warning: Found 511490 key parts. Should be: 0
Error: Corrupt

And every page on the site craps out with the following errors:

MySQL Error : MySQL server has gone away

What do I do? I accept that I am gonna probably loose all my posts, but what can I do to get the site up and running again? Can I just dump and rebuild the POST table without loosing everything else, my member list, etc?

Any help gratefully accepted! :erm:

benstillman
01-20-2011, 03:28 PM
First thing's first; do you have a recent backup of the database?

If not, oops.

Do you have root access to the server? You'll need to run myisamchk from the command line.

As root...
- Shut down mysql.
- Run: myisamchk -r -q /var/db/databasename/post.MYI (Obviously replace /var/db/databasename/post.MYI with the correct path to the post.MYI file. )
- If errors are repaired, start mysql.

--------------- Added 1295544584 at 1295544584 ---------------

Here's a good article: http://www.thegeekstuff.com/2008/09/how-to-repair-corrupted-mysql-tables-using-myisamchk/

snakes1100
01-20-2011, 03:37 PM
You should run a key repair with the -o option from the cmd line, run a -r after the key recovery.