A few days ago, WordPress encountered an error message, and when opened, it displayed "Error Establishing Database Connection".
The translation of this sentence is "An error occurred while establishing a database connection."
The cause of the problem:
The database may have been paused due to low configuration. Generally, our server requires at least 1GB of memory by default, and it needs to accommodate the website and the database. If the website has high traffic, it may cause a sudden surge in traffic, leading to the database being paused.
After investigation, it was found that when testing the website's concurrency capability, the MySQL database occupied too much memory and was shut down by the Linux system. The kernel terminated the process.
Solution:
The solution is simple, just restart the MySQL database service.
service mysqld restart
If the website frequently encounters this problem, you can consider upgrading the server configuration, increasing the memory, or adding SWAP memory.