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
1. Concurrency Concurrency is the most important ...
1. Installation process MySQL version: 5.7.18 1. ...
Install virtualization software Before installing...
The data type of MySQL is datetime. The data stor...
background This article mainly tests whether the ...
Preface Recently, a data was operated incorrectly...
Table of contents 1. Introduction 2. Usage Statel...
answer from stackflow: Simply <br> is suffic...
The code looks like this: <!DOCTYPE html> &...
This is my first time writing a blog. I have been...
Abstract: Analysis of two MySQL SQL statement loc...
This article describes the MySQL transaction mana...
Table of contents Install and configure dnsmasq I...
Table of contents 1. Index Basics 1.1 Introductio...
1. Unzip the file to the current directory Comman...