Let's share the following, the way to close the MySQL log
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
Log-bin=mysql-bin
Binlog_format=mixedbash
Note the two lines, 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
Service Mysqld Restartbashssh
Execute the above command, restart MySQL to make annotations effective
Third, delete the log generated before
1) Login MySQL
/usr/local/mysql/bin/mysql-u Root-pbashssh
To execute the above command, enter the MySQL command line mode after entering the password.
2) Reset the account number
Reset Qzkyl;
#qzkyl请修改为目标数据库名
The following are supplementary:
Today found the VPS hard drive incredibly fast full. The first reaction is that it must have been caused by a log file of something, because there had been a similar experience in Windows before.
Analyzed, found the reason: MySQL log file.
You can also use the following command to check (if not lnmp, the path may be different):
Copy Code code as follows:
Du-h--max-depth=1/usr/local/mysql/var/*
If you see a large number of large files, and named mysql-bin.000014, you also need to close the log file, because you do not know which day they will put your VPS hard drive full.
Use WinSCP to remove these files.
How to close:
Copy Code code as follows:
Found it:
Copy Code code as follows:
Log-bin=mysql-bin
Binlog_format=mixed
[Code]
Comment out these two lines and precede with #
and then save.
Finally, use the following instructions to restart the next lnmp. Wrap
[Code]
/ROOT/LNMP restart