• Skip to primary navigation
  • Skip to main content
  • Skip to footer

Chad Ritchie

Graphic Designer, Front-End Web Developer

  • Blog
    • WordPress
  • Projects
    • Graphic Design
    • Web Projects
  • Photos
  • Services
  • Contact

Repair WordPress Database

June 26, 2013 By Chad Ritchie

On your WordPress site, if you receive the “Error establishing a database connection” on both the front-end of the site, and the back-end of the site (wp-admin). Then you may need to repair your database.
You can do this by adding the following line in your wp-config.php file:

define('WP_ALLOW_REPAIR', true);

Once you have done that, you can see the settings by visiting this page: http://www.YOURSITE.com/wp-admin/maint/repair.php

You do not need to be logged in to your site for this to work. This is because the main intent is to repair the corrupted database, users can not login when the database is corrupt. So once you finish repairing/optimizing your database, make sure to remove the code from your wp-config.php file.

  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on X (Opens in new window) X

Filed Under: Blog, WordPress

Footer

Chad Ritchie Web & Graphic Design