The solution that the MYSQL database on the VPS server always stops automatically

Original link: https://www.xujiahua.com/9973.html

Why does the MySQL database stop running suddenly?

Generally, MySQL termination is caused by insufficient memory or continuous high-load reading and writing.

What should I do if Mysql always stops automatically and repeatedly?

The solution is very simple, refer to the two articles written by Brother Diary. Combining these two articles can basically solve the problem:

The method of setting SWAP virtual memory, the solution of insufficient VPS memory, and improve your VPS performance

The load status of the VPS host Linux pagoda panel shows 100%, and the server CPU occupies 100% of the solution

If none of the above two articles can solve the problem, you can set a scheduled task in the scheduled task to check and monitor the status of MYSQL every day. If it is closed, it will be started automatically.

The script for the scheduled task is as follows:

pgrep -x mysqld &> /dev/nullif [ $? -ne 0 ]; then bash /www/server/panel/script/rememory.sh/etc/init.d/mysqld startfi

Of course, this is more or less a temporary solution.

If there are still frequent problems, then you have to consider that your machine is really unable to support your website. Either reduce the website, or insert fewer website plug-ins, or upgrade your VPS.

Please indicate when reprinting: Diary Boy’s Blog » The solution to the MYSQL database on the VPS server always stopping automatically

This article is transferred from: https://www.xujiahua.com/9973.html
This site is only for collection, and the copyright belongs to the original author.