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

Source: Internet
Author: User
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 the file configuration and modify/etc/my. cnf. find the following characters:

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, 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.