Error establishing a database connection in WordPress

Error establishing a database connection in WordPress
Example:


There are several reasons why your WordPress site is unable to connect to its database

1. Incorrect database credentials

2. Database server issues
3. A corrupted database
4. Corrupted files

1. Incorrect database credentials
Now, edit your wp-config.php file and enter the username,password,Host Correctly.
Example:


2. Database server issues
The database server is down
or
Your database server is overloaded

3. A corrupted database
Enable the WordPress Database Repair

your wp-config.php file using the editor.
Scroll to the bottom of the file and add the following line of code:
define( 'WP_ALLOW_REPAIR', true );
Next, open up a new tab in your browser. Navigate to the following URL:

http://yoursite.com/wp-admin/maint/repair.php

you can select either “Repair Database” or “Repair and Optimize Database”.

4. Corrupted files
Check you all *.php files..

Post a Comment

0 Comments