Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Wordpress installation that has a corrupt table, wp_posts. Unfortunately, I also had two hard drives fail recently and I do not have a backup of this database.

I want to make a local backup before I attempt to repair the table, but when I go to export the database as sql, I'm not able to get a complete backup. When I backup through wordpress, if gives me an error but gives me an sql file anyway, missing the data for this table. When I try to access the database directly and dump it, I get a 1kb file with no data in it.

I have seen online that a number of people have successfully repaired their Wordpress tables. There is even a script now that attempts to do this automatically. However, it would make me feel a lot better to get a local, broken copy of the db to operate on. Does anyone have any advice on how to do this?

Thank you. P.S. I use a GUI called Heidi SQL to access the db remotely.

share|improve this question

migrated from Dec 9 '11 at 15:53

This question came from our site for professional and enthusiast programmers.

Although this question should really be asked on serverfault, here's a hint:

When you have access to the server, simply copy the data directory (can be found by using show variables like 'datadir';) and copy it anywhere you like. Then you can issue the repair commands (or whatever wordpress happens to bring along).

Exporting a broken table to an sql file is, per definition, something that I would never expect to work.

share|improve this answer
If it's MyISAM, then you can just copy the wp_posts* files. There should be 3 of them. But if it's Innodb, you should copy the whole directory. – Brent Baisley Dec 9 '11 at 1:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.