Wordpress showing "Error Establishing Database Connection"
We're seeing random instances of "Error Establishing Database Connection" lasting just under a minute each on our WordPress website. We noticed this after enabling some Apache modules in order to enable Browser Caching functionality in a plugin called WP-Rocket, although we are not sure that this is what caused it (It may have been happening before).
We checked wp-config.php and the database tables and everything seems fine and not corrupted. How can I troubleshoot this?
1 Reply
There's not really enough information here to give you an exact diagnosis, but a good first step to troubleshoot this would be to find out if the error resides in your Database or within WordPress. When you notice the "Error Establishing Database Connection", are you able to connect to the database manually via command line? Do you have remote database access, or a database explorer such as phpmyadmin set up? If you do, I would see if you can connect to the database while the WordPress website is showing the error message.
If you CAN connect to the database just fine, the issue is probably a problem that resides somewhere within your WordPress website, while if you CAN NOT connect to the database, you should take a closer look at your database logs and find out why your database is not accessible.