I recently helped someone with a project and the MySQL machine kept stopping automatically after a while. At first I thought it stopped unexpectedly, so I didn't pay attention and restarted it manually. But after two days it stopped again. Later, I carefully checked the mysqld log:
The above message shows "Cannot allocate memory for the buffer pool". Using top, I saw that mysqld was using 48% of the memory. The memory usage is still quite high. Of course, upgrading the machine configuration is a better solution, but after all, funds are limited. So let's add a swap space to it first: dd if=/dev/zero of=/swapfile bs=1M count=2048 mkswap /swapfile swapon /swapfile systemctl restart mysqld Above we added 2GB of swap space to the machine. Then restart mysqld. I used top again and found that the swap space was gradually being used. After a nap, I woke up and found that the mysqld service did not stop automatically, and the memory usage had dropped to 22%. I looked at the error log and it was empty. Well, it looks good. Just observe for a few more days and if there is no problem, it should be fineπππ. Well, this is the end of this article about how to handle the problem of MySQL automatic shutdown. For more relevant content about MySQL automatic shutdown handling, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Detailed explanation of this reference and custom properties in JavaScript
>>: How to implement one-click deployment of nfs in linux
Table of contents Overview Implementation Protect...
Table of contents 1. Introduction 2. Understand t...
It is troublesome to install the db2 database dir...
This article example shares the specific code of ...
1.ssh command In Linux, you can log in to another...
illustrate When you install the system yourself, ...
Table of contents for loop While Loop do-while lo...
This article introduces the method of using CSS3 ...
XML/HTML CodeCopy content to clipboard <!DOCTY...
First look at the effect: Code: 1.html <div cl...
Look at the code first Copy code The code is as fo...
When I was in the securities company, because the ...
http return code list (below is an overview) for ...
Preface When making a top menu, you will be requi...
The general way of writing is as follows: XML/HTM...