How to disable Mysql Log during one-click LNMP package installation

Source: Internet
Author: User
Tags mysql command line

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 for this tutorial is applicable to the one-click installation package environment of LNMP. For other environments, perform the operations as needed.

To disable it, perform the following operations:


1. Modify file configuration

Modify/etc/my. cnf and find the following characters


Log-bin = mysql-bin binlog_format = mixed

Note the two rows as follows:


# Log-bin = mysql-bin # binlog_format = mixed

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


Ii. Restart Mysql to make it take effect
Service mysqld restart

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


3. delete logs generated before
1) log on to MYSQL
/Usr/local/mysql/bin/mysql-u root-p

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


2) resetting an account
Reset kwxgd; # Change kwxgd to the target database name.

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.