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

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

When using VPS host, many webmasters will use one click installation package to build the system, and then set up their own website. If our website runs a lot of data, they will find that the disk is full after using it for a period of time, but the content of their website is not so large, and if the LNMP is installed After the system, we found that 502 error prompts often appear. Most of this is because our MYSQL log files fill up our disk space. We need to clean them up.

We can clean the MYSQL log file through the following command:

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.

Vote for you
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