The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". The cookie is used to store the user consent for the cookies in the category "Analytics". This cookie is set by GDPR Cookie Consent plugin. These cookies ensure basic functionalities and security features of the website, anonymously. Necessary cookies are absolutely essential for the website to function properly. Whenever you want to clear the browser cache, just replace ‘aojfkesj’ with a random string of letters like this: So we recommend doing this instead –Īdd this to the end of your site URL: ?x=aojfkesj Google Chrome allows you to clear cache via the setting option and it’s a time-consuming process. Make sure you clear the cache every time you check the site. But even if the error disappears, you might still see it on your site’s front end because of the browser cache. IMPORTANT: Every time you try a solution, you will need to check whether it helped remove the error from your site. It’s hard to pinpoint the exact reason so we recommend trying out all the solutions in this article. Since there are a number of reasons why a database connection fails, there are a number of solutions too. The fix depends on the cause of the database connection failure. We have covered the solutions in the next section. No matter what the cause is, there are ways to fix the “error establishing database connection” warning on your WordPress website. This will cause the database to become unresponsive because it’s not used to handling a large amount of traffic. For instance, if one of your posts went viral or if your site was under a DDoS attack, your site will experience a sudden spike in traffic. That said, normal usage like installing and deleting plugins can also lead to errors.Īnother reason you are experiencing a problem with your database could be a sudden spike in traffic. The database connection issue can also occur if the database has been manually tinkered with.
If the file gets corrupted, WordPress shows the “error establishing database connection” warning on the frontend of the site.īesides corruption of the wp-config.php file, other reasons that cause the error include accidentally changing the database login credentials, problems with your hosting provider like hardware failure, data loss, and power outages. This information is stored in the wp-config.php file.
Note: If any of the information in the wp-config.php file doesn't match your database details, then update the file with the correct information. yourtableprefix: Replace this with your table prefix.yourhostname: Replace this with your MySQL hostname.
yourpassword: Replace this with your MySQL password.yourusername: Replace this with your MySQL username.yourdatabasename: Replace this with your MySQL database name.Check if the information in this file matches the database details you found earlier.** The name of the database for WordPress */ In the wp-config.php file, locate the section that looks like this example:.Find and open the folder your WordPress site is in. Connect to your hosting account with FTP.The database prefix is appended to the table names (for example, if you see the following database tables: wp_3f_options, wp_3f_ posts, wp_3f_postmeta, etc., your database prefix is wp_3f_). In phpMyAdmin, on the left menu, select the name of the database your site uses.Note: If you see errors other than Error establishing a database connection on your site, check out our troubleshooting article.