Shut down MySQL log in Linux resolve mysql-bin.0000* log consumption resource issue

Source: Internet
Author: User
Today, I saw a VPS installed LNMP environment under a Web site can not open, but also the problem of the database could not be linked, through the df-l to see the hard disk occupy 100%, it appears to be due to disk occupancy. There is no special case, the default installation of the LNMP one-key package environment is not closed MySQL log, will result in the generation of mysql-bin.0000* log files, if the site may not be found in the early days of the problem, time will occupy the hard drive.
First, the log file address
The code is as follows Copy Code
/usr/local/mysql/var/

In the above folder, there are several m to several G, we do not rush to delete all, you can choose a few large deletions can be.

We can remove the log from the selection of a few 1G or so.

Second, restart MySQL

/etc/init.d/mysql restart

After the reboot, we'll look at the hard drive footprint.

Third, prohibit MySQL log
The code is as follows Copy Code
/etc/my.cnf

Edit this file, find Log-bin=mysql-bin and binlog_format=mixed two lines, before # comment out. Again, we restart MySQL to take effect.

In this way, we can resolve the MySQL log file caused by the hard drive is too large.

Related Article

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.