How to disable mysql log to protect hard disk space _ MySQL

Source: Internet
Author: User
Lnmp how to disable mysql log Protection hard disk space LNMP

BitsCN.com

Today, we found that the VPS hard disk is almost full. The first reaction is: it must have been caused by a log file of something, because it had similar experience in WINDOWS before.

After analysis, find the reason: MYSQL log file.

You can also run the following command to check the path (if it is not LNMP, the path may be different ):


Du-h -- max-depth = 1/usr/local/mysql/var /*

If you see a lot of large files named mysql-bin.000014, it means you also need to close the log file, because you don't know which day they will fill up your VPS hard disk.

Use WINSCP to delete these files.

How to disable:


Vi/etc/my. cnf

Find:

Log-bin = mysql-bin
Binlog_format = mixed
[Code]
Comment out the two lines, and add #
Save the settings.
Run the following command to restart LNMP. Close.
[Code]
/Root/lnmp restart

BitsCN.com

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.