How to turn off the Mysql log under Lnmp Protect disk space _mysql

Source: Internet
Author: User
Tags ssh mysql command line

LNMP a key package installed MySQL default open MySQL log, if the site on the database read and write more frequently may generate a large number of logs, and occupy disk space, but also may lead to the VPS's hard disk idle space consumption full cause the database can not be opened.

The path to this tutorial applies to the LNMP one-click installation package Environment , depending on the circumstances.

If you need to close, do the following:

First, modify the file configuration

Modify/ETC/MY.CNF to find the following characters

Copy Code code as follows:

Log-bin=mysql-bin
Binlog_format=mixedbash

Note the two lines, as follows:

Copy Code code as follows:

#log-bin=mysql-bin
#binlog_format =mixedbash

Add the "#" note before these two fields and save the file.

Second, restart MySQL to make it effective

Copy Code code as follows:

Service Mysqld Restartbash

SSH executes the above command, restart MySQL to make annotations effective

Third, delete the log generated before

1) Login MySQL

Copy Code code as follows:

/usr/local/mysql/bin/mysql-u Root-pbash

SSH executes the above command and enters the MySQL command line mode after entering the password.

2) Reset the account number

Copy Code code as follows:

Reset Qzkyl; #qzkyl请修改为目标数据库名

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.