A tutorial on how to close and delete MySQL logs under Linux

Source: Internet
Author: User

LNMP One-click installation of the install package MySQL default is to open the log file,

If the data operation is more frequent, it will produce a lot of logs.

A mysql-bin.0000* similar file is generated below the/usr/local/mysql/var/,

And generally in dozens of MB to a few GB, more will eat the entire hard disk space,

Never cause MySQL to start or error, such as VPS Forum user feedback.

How to turn off the MySQL log function: Delete log: execution:/usr/local/mysql/bin/mysql-u root-p

Enter password login and then execute: RESET master;

Re-enter: Quit exit MySQL command mode.

Completely disable MySQL log: Modify/etc/my.cnf file,

Find Log-bin Search =mysql-binbinlog_format=mixed and then add the # in front of these two lines,

Comment it out, and then execute/etc/init.d/mysql restart.

or directly to the directory/usr/local/mysql/var/delete log files can be used normally!

After the above methods, you have to close and delete the MySQL log, but I still suggest you open, so if there is a problem can be traced to the log quickly resolved.

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.