WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Database Problem (24 posts)

  1. Vera Schafer
    Member
    Posted 4 years ago #

    I got the error:
    "One or more database tables are unavailable. The database may need to be repaired"

    I tried to fix the problem by adding this line to the wp-config.php:
    define('WP_ALLOW_REPAIR', true);

    Then I got the Repair Database screen, but when I click on it, I get a "Are you sure you want to do this? Please try again.". But every time I click on the "Please try again" button, it shows the "Repair Database" screen again.

    What am I doing wrong?

  2. s_ha_dum
    Member
    Posted 4 years ago #

    Maybe nothing. WordPress may not be able to repair the DB. Can you get to the database by some other means? Through your web host's backend?

  3. Vera Schafer
    Member
    Posted 4 years ago #

    I do have a backup of the database, but I don't know how to restore it via WP.

  4. workingroup
    Member
    Posted 4 years ago #

    Are you talking about your SQL database or the WP back up created via the tools menu?

    If you host with a company which allows WP sites, their tech support should resolve this issue for you.

    Also there are some good plugins which create backups and do restores, try searching for one in your plugin interface in admin

  5. Vera Schafer
    Member
    Posted 4 years ago #

    I really don't know. WP just mentions "Database".
    As for the plugins, it doesn't let me access the admin interface either :>(

  6. s_ha_dum
    Member
    Posted 4 years ago #

    You only have one database. The question concerns how you got the backup. Did you use the built in WP control panel or did you access you database by some other means and back it up?

  7. Vera Schafer
    Member
    Posted 4 years ago #

    I backed that up using my server's backup tool. It's a xml.tar file format which I saved to my computer.

  8. s_ha_dum
    Member
    Posted 4 years ago #

    What server backup tool did you use? You want to know for sure that you have a complete, and not just a partial, backup.

    What other tools does your host provide? Does PHPMyAdmin ring a bell?

  9. Vera Schafer
    Member
    Posted 4 years ago #

    First let me thank you very much for your close follow-up. That was the first time I did a back-up and I just used the backup instructions offered by my server. I use Plesk to access the server. PHPMyAdmin doesn't ring a bell in this case ... Today I used the restore feature in the same Plesk interface, got a confirmation that it was restored successfully but it still doesn't work.

  10. s_ha_dum
    Member
    Posted 4 years ago #

    Ok. Login to Plesk. When I login to Plesk I end up on a page with a few buttons at the top and my domain listed at the bottom. Click the domain and find the database button. It looks like two stacks of poker chips, at least on the version I'm using. Click the database button. You should get a listing of available servers, probably only on labeled something like 'Local MySql Server'. Click the Server. Now, hopefully, you will see a button labeled 'DB WebAdmin'. It looks like a single stack of poker chips with a wrench next to it. Click the Button. Hopefully you'll get a window with phpMyAdmin running in it. If you do, click on the database name and on the various tables and look around for errors. phpMyAdmin will tell you if you have damaged tables. Be careful though and don't click anything that looks like a big red X. If you get any messages about 'dropping' or 'truncating' anything, do not say OK. 'Drop' and 'Truncate' basically mean 'Delete' and it is permanent.

    Once you get into phpMyAdmin. I'd recommend backing up everything before doing anything else. Click the database name and look across the row of tabs to 'Export'. Click it. Select everything (the list of tables) under 'Export' with the SQL radio box selected. Click 'Save as File'. Click 'Go'. Save the file. Open the file with a text editor like Notepad and make sure it has stuff in it. Close the file. Now you have a second backup.

  11. Vera Schafer
    Member
    Posted 4 years ago #

    I am waiting for an answer from the server because, apparently, my Plesk's version is different as I don't see the same buttons. Your detailed instructions are easy to follow but when I get to a database button, I don't see what you explained.

  12. Vera Schafer
    Member
    Posted 4 years ago #

    I hope you are still following this thread. I wasn't able to restore the backup from Plesk but I was able to rescue a file that was generated by wordpress backup plugin and sent automatically to me a few days before the site disappeared. The file is a *.sql.gz format. Do you think I could try to use Plesk to restore from this file or should I just upload it via FTP to the server? If so, to which directory I should upload it to?

  13. s_ha_dum
    Member
    Posted 4 years ago #

    You can't upload files into MySql via FTP and I'm not sure if PhpMyAdmin with accept .gz files. It might. .gz is a compression format, something like .zip. You need to decompress it then import using PhpMyAdmin. But I thought we were trying to repair the database, at this point, not restore it from a backup. What happened? Maybe you are on the right track, its just that I seem to have missed a step.

  14. Vera Schafer
    Member
    Posted 4 years ago #

    I was trying to repair the database but the server said that file was empty
    (?!?). Is there a software I can download to my Mac in order to decompress this .gz file?

  15. s_ha_dum
    Member
    Posted 4 years ago #

    I was trying to repair the database but the server said that file was empty

    That sounds suspiciously like a server crash. Have you asked your host if they've had any issues?

  16. Vera Schafer
    Member
    Posted 4 years ago #

    Well, he blamed me for not making a backup before I updated WP. I do have a few other blogs with this server (a friend of my daughter) and they are all workings just fine. I'm afraid I'll never know who to blame, if any.

  17. Vera Schafer
    Member
    Posted 4 years ago #

    But since I still have the other file, generated by WP plugin *.sql.gz that was received before I upgraded WP, I still can try to restore this one, right?

  18. s_ha_dum
    Member
    Posted 4 years ago #

    Well, he blamed me for not making a backup before I updated WP.

    Well, you should have made a backup. I hope he was nice about it at least.

    I didn't realize that this began with an upgrade, though. That would have been helpful in the beginning. This did happen immediately after an upgrade, right?

    Now, to be clear: You currently have no WP database online for this blog. I ask because restoring from the gzip-ed file will destroy anything left on the existing database or at least make a big mess if it doesn't. Ok, maybe a wee bit melodramatic, but this not something to do lightly. Also, I don't know what is in that .gz file. Hopefully it pulled down everything.

  19. Vera Schafer
    Member
    Posted 4 years ago #

    Well, let me clarify something: we are talking about 2 backups:

    1) The one I found on Plesk = that one my server says he tried to restore too but it is empty.

    2) The one I got automatically from WordPress before the update. This one I haven't tried to restore yet, cause I don't know if I can do it using WP MyPhPAdmin or if I have to upload it to Plesk then restore.

  20. Vera Schafer
    Member
    Posted 4 years ago #

    Correct. Now I only have the template as WP was re-installed. So, this backup would not destroy anything.

  21. s_ha_dum
    Member
    Posted 4 years ago #

    Ok. You need to un-gzip the backup. I don't remember if Windows will do it natively or if you need to download something like Alzip. Once you have it un-gzipped and you have a .sql file you need to do this. If you have a good backup it should work out OK. This process won't destroy the backup .sql file, so you can do it over if you need to.

  22. Vera Schafer
    Member
    Posted 4 years ago #

    I'm on a Mac, but I'll look for it. Pls keep your fingers crossed for me :>(

  23. Vera Schafer
    Member
    Posted 4 years ago #

    It worked like a charm! I can't thank you enough for your time and patience! It is not recognizing my Admin password anymore but I guess I can try to get it via email. Just wanted to thank you, thank you! thank you! You are my hero!

  24. Vera Schafer
    Member
    Posted 4 years ago #

    Just an update to let you know that I managed to recover admin password as well, by following instructions on Codex to upload an emergency.php file to the server and deleting the file afterwards. Thank you again for all your help. I learned a lot these past days! Closing this topic now for good :>)

Topic Closed

This topic has been closed to new replies.

About this Topic