How to Fix WordPress Error Establishing Database Connection
Sometimes WordPress site will display a default “error establishing database connection” error message page. Any number of problems can happen to cause this, such as cannot connect or having problem connecting to the database correctly, database login credentials wrong or have been changed, too many connections exceeding maximum connection allowed, or database server unresponsive or corrupted.
These WordPress error page are more meant for website administrators or webmasters rather than the public visitors. Further, the WordPress site may display “one or more database tables are unavailable. The database may need to be repaired”, then you need to repair your database. Here’s how to fix the error establishing a database connection in WordPress.
- WP-Config.php is probably the single most important file in entire WordPress installation. First, check all the wp-config.php file is correct and same without any changed.
define(‘DB_NAME’, ‘your-database-name’);
define(‘DB_USER’, ‘your-database-username’);
define(‘DB_PASSWORD’, ‘your-database-password’);
define(‘DB_HOST’, ‘your-localhost’);
- Next, check login page whether get errors for the same “Error Establishing Database Connection”. It may be getting a ton of traffic especially if you are using a shared server. Immediately contact hosting provider.
- If WordPress site shown “One or more database tables are unavailable. The database may need to be repaired” then you will 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
- Next, the screen will appear with two repair options. Just click Repair Database.
- The WordPress site will recover once completed repair.
- Go to wp-config.php file and remove “define(‘WP_ALLOW_REPAIR’, true)”, and then Save the file.
Recent Articles
- How To Download HBO Shows On iPhone, iPad Through Apple TV App
- Windows 10 Insider Preview Build 19025 (20H1) for PC Official Available for Insiders in Fast Ring – Here’s What’s News, Fixes, and Enhancement Changelog
- Kaspersky Total Security 2020 Free Download With License Serial Key
- Steganos Privacy Suite 19 Free Download With Genuine License Key
- Zemana AntiMalware Premium Free Download For Limited Time