whost

whost

网站建设和主机推荐

What to do when the website shows Error Establishing Database Connection

A few days ago, Wordpress encountered an error message, and when opened, it displayed Error Establishing Database Connection.

This sentence translates to "An error occurred when establishing the database connection."

database-error.png

Analysis of the Cause of the Problem

The database being paused may be due to low configuration. Generally, our server defaults to needing at least 1GB of memory to start, and it also needs to host the website and database. If the website has high traffic, it may cause a surge in traffic leading to the database being paused.

After investigation, it was found that when testing the website's concurrency capabilities, the MySQL database consumed 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 issue, consider upgrading the server configuration, increasing memory, or adding SWAP memory.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.