How to disable Mysql log Protection disk space in lnmp _ MySQL

Source: Internet
Author: User
This article describes how to disable Mysql logs to protect disk space in lnmp. For more information, see Mysql installed in the LNMP one-click package enables Mysql logs by default. if the website reads and writes data to the database frequently, it may generate a large number of logs and occupy disk space, it is also possible that the idle space of the VPS hard disk is fully occupied and the database cannot be enabled.

The path of this tutorial appliesLNMP one-click installation package environmentAnd other environments.

To disable it, perform the following operations:

The code is as follows:


Log-bin = mysql-bin
Binlog_format = mixedbash

Note the two rows as follows:

The code is as follows:


# Log-bin = mysql-bin
# Binlog_format = mixedbash

Add the "#" comment before the two fields and save the file.

The code is as follows:


Service mysqld restartbash

Run the preceding command in SSH and restart Mysql to make the comment take effect.

The code is as follows:


/Usr/local/mysql/bin/mysql-u root-pbash

Run the preceding commands by using SSH, enter the password, and enter the MYSQL command line mode.

2) resetting an account

The code is as follows:


Reset qzkyl; # change qzkyl to the name of the target database.

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.