Focus on cloud service provider activities
Notes on website operation and maintenance

Share the operation method of closing the VPS host MYSQL log file

Many of our webmasters will use the one click installation package to build the system when using the VPS host, and then set up their own website. If our website runs a lot of data, they will find that the disk will be full after using it for a period of time, but the content of their website is not so large, and if the LNMP system is installed, they often find 502 error prompts, This is mostly due to our MYSQL Log Files fill up our disk space, we need to clean it.

We can clean it with the following command MYSQL Log File:

rm -f /usr/local/mysql/var/mysql-bin.*

Then we restart our VPS. If LNMP is used:

/root/lnmp restart

In this way, we will delete the redundant garbage log files. If we need to disable the generation of these logs, we can do so in the following way.

Find the/etc/my.cnf file

log-bin=mysql-bin

binlog_format=mixed

Comment out the above two lines by adding "#" in front of them. In this way, MYSQL log files will not be generated. I suggest you keep it, so that you can see the problems if there are errors. If it is full of manual cleaning, it will not be troublesome.

Domain name host preferential information push QQ group: six hundred and twenty-seven million seven hundred and seventy-five thousand four hundred and seventy-seven Get preferential promotion from merchants.
Like( zero )
Do not reprint without permission: Lao Zuo's Notes » Share the operation method of closing the VPS host MYSQL log file


Scan the code to follow the official account

Get more news about webmaster circle!
Entrepreneurship, operation and new knowledge