it’s an error establishing a database connection. Here’s what it means exactly:
WordPress uses two main pieces of technology to provide you with all its awesome abilities: PHP and MySQL.
PHP is a programming language. WordPress – the core WordPress files – have been written in PHP. Boring, sorry.
MySQL is a database technology. WordPress uses a MySQL database to store all of your website’s content. This includes your posts, pages, but also the smaller elements, such as the title of your site, the layout of your widgets, the color settings, and etc. Basically, the MySQL database is where every, even the smallest piece of information about your website, is kept.
Putting the two together, WordPress uses PHP commands to connect to the MySQL database, get the information it needs, and then displays everything on the screen.
This is where the error comes into play. The error occurs when, for whatever reason, WordPress cannot access the information in the database via PHP commands. When that happens, WordPress basically doesn’t know what to do next, so the only thing it can say is, “Error establishing a database connection.”
With that being said, there can be a handful of reasons why the error occurs. Some of the more common ones:
Incorrect login credentials. WordPress needs a specific login and password to access the database. If those have changed for any reason then WordPress will no longer be able to fetch anything from the database.
Corrupted WordPress files. The core WordPress files can get corrupted as a result of a failed update, among others. This can include things like failed updates of the plugins, themes, and even the main WordPress software updates.
Corrupted database. This might be a result of a rogue plugin messing up the database internally, a hacker’s attack, a theme failing, and many more.
The database server is down. In some cases, the web server – the server that stores your website files – is run on a different machine than the database. And that separate database server can simply be down for whatever reason.
Too much traffic. Even though this is a good problem to have, it’s still a problem. Specifically, your database might be unresponsive due to a high spike in traffic. For example, maybe one of your posts went viral and now everyone and their dog tries to access your site? Hence the server is not able to handle part of those visits.