1. Disable any WordPress plugins or themes that you recently installed
Key steps
1. Check if your database details are correct in your configuration file: First and foremost, you should check if your database details are correct in the configuration file of your website. There are usually two configuration files with the name dbname.php or wp-config.php in the root folder of your website. In these configuration files, you will find the following details:
• Host (It is usually localhost, but certain hosting providers may require something else.)
• Database username
• Database password
• Database name
If any of these details are incorrect, your website won’t be able to establish connection with your database which results in the “Error Establishing a Database Connection” issue. So make sure the details are correct.
2. Check the MySQL service
You need to make sure that MySQL service is running on your hosting server. Usually, if MySQL service is not running properly on your hosting server, it gives the “Error Establishing a Database Connection” issue. To check if the MySQL service is running, contact your hosting provider and ask them to check the MySQL service on your server.
3. Check if the database has reached its size limit
If the database of your website is reaching its size limit, then it is possible that your website may give the “Error Establishing a Database Connection” issue. To check if the size limit has reached, contact your hosting provider and ask them to check the status of the database size.
4. Check the Database connection hostname
Hostname plays a very important role in connecting your website to the database. If the hostname is incorrect then your website won’t be able to establish the connection with your database which will result in the “Error Establishing a Database Connection” issue. To verify your hostname contact your hosting provider.
5. Check your website’s IP address
If your website’s IP address has been blocked for any reasons, then it is possible that your website may give the “Error Establishing a Database Connection” issue. To check if this is the reason, contact your hosting provider and ask them to unblock your website’s IP address.
6. Check your WordPress files and folders’ permissions
WordPress files and folders are usually encrypted with certain set of permissions (e.g. 755). If they are not encrypted with the correct permissions then your website may give the “Error Establishing a Database Connection” issue. To check the encryption, contact your hosting provider and ask them to verify if the permissions are correctly set for the WordPress files and folders.
7. Check for corrupted files
Another reason for the “Error Establishing a Database Connection” issue can be corrupted files. If any of the WordPress core files have been corrupted then it is possible that your website may give this error. To check for corrupted files, contact your hosting provider and ask them to verify if any of the files are corrupted.
8. Check for any plugin and theme related issues
If you recently installed a plugin or a theme on your website, then it is possible that those can be the reason for this issue. To check if any of the plugins or themes are causing the issue, you can disable all the plugins and themes and then check if the issue is still there. If the issue is resolved then you can start to enable each plugin and theme one by one to find out which one is causing the issue.
9. Check the memory limit
If your website has exceeded its memory limit, then it is possible that your website may give the “Error Establishing a Database Connection” issue. To verify your memory limit, contact your hosting provider and ask them to increase your memory limit, if required.
Save Time and Money: Get Professional Help With Our Services