Lnmp the method of closing the MySQL log is detailed

Source: Internet
Author: User
Tags log log

itself MySQL will generate a bunch of mysql.bin.* of the log, for our small web site, there is no real big use, and may be stuffed with our hard drive. Under normal circumstances, the little night will shut him, anyway I have every hour of mysqldump export record archive.

Locate the file/etc/my.cnf note the following 2 line files:

#log-bin=mysql-bin
#binlog_format =mixed

Of course, if you have to keep, you can shorten the log save time, the default is 10 days.

Expire_logs_days = #修改此项即可

We can use the following command to clean the MySQL log file:

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

Then we reboot our VPS if it is LNMP used:

/ROOT/LNMP restart


Mysql

Slow query log

Note or delete the log-slow-queries directive in my.cnf, no this instruction does not generate a log by default.

Binary Bin-log Log

Note or delete the Log-bin directive in my.cnf, no this instruction does not generate a log by default.

Error log

Log-error=/dev/null, there is no default build log for this directive.

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.