• Hello WordPress World

    When I tried navigating to my website I got the dreaded:

    Error establishing connection to database

    When I tried navigating to my admin login https://www.website/wp-admin I got

    One or more database tables are unavailable. The database may need to be repaired.

    So I google the problem and decided to follow the instructions in this great article:

    https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-error-establishing-a-database-connection-in-wordpress/

    As instructed I added the following line of code to wp-config.php

    define('WP_ALLOW_REPAIR', true);

    My website is back up and running however the output of repair.php was

    Some database problems could not be repaired. Please copy-and-paste the following list of errors to the WordPress support forums to get additional assistance.
    
    wp_posts: 1 client is using or hasn't closed the table properly
    wp_options: Table is marked as crashed

    This is the 2nd time in the last 2 weeks I’ve had to repair my database this way.

    2 questions:

    1. What is the underlying cause?

    2. How do I resolve the exceptions reported above that repair.php was unable to fix?

    Cheers

Viewing 4 replies - 1 through 4 (of 4 total)
  • Try:
    – switching to the default theme by renaming your current theme’s folder inside wp-content/themes and adding “-old” to the end of the folder name using FTP or whatever file management application your host provides.

    resetting the plugins folder by FTP or phpMyAdmin.

    – repairing all database tables using a tool like Phpmyadmin. If necessary, ask your hosts how you can access such a tool on the server.

    Thread Starter LordLiverpool

    (@lordliverpool)

    Hi esmi

    Thank you for the swift response!

    1.) I am using Twenty Twelve and I created a child theme to preserve my modifications. So should I rename my child theme from twenty-twelve-child to twenty-twelve-child-old?

    2.) I will try using Filezilla to change the name of the plugin folder and then change it back as per the instructions in your link.

    3.) I know my server doesn’t have phpMyAdmin installed so I will contact my server provider to see if they will help me with that. If not I will google how to install it. Assuming I manage to install phpMyAdmin what corruption am I looking for within the tables? Missing values e.g. Missing foreign keys?

    Thanks for your help.

    So should I rename my child theme from twenty-twelve-child to twenty-twelve-child-old?

    Yes

    what corruption am I looking for within the tables?

    Don’t even try looking for corruption in specific records. Just try running a repair on every table

    Thread Starter LordLiverpool

    (@lordliverpool)

    Thanks EMSI you’re a good person.

    I will report back my results so this is a meaningful thread.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Error establishing connection to database’ is closed to new replies.