Today, I saw a VPS installed LNMP environment under a Web site can not open, but also the problem of the database could not be linked, through the df-l to see the hard disk occupy 100%, it appears to be due to disk occupancy. There is no special case, the default installation of the LNMP one-key package environment is not closed MySQL log, will result in the generation of mysql-bin.0000* log files, if the site may not be found in the early days of the problem, time will occupy the hard drive.
First, the log file address
| The code is as follows |
Copy Code |
|
/usr/local/mysql/var/
|
In the above folder, there are several m to several G, we do not rush to delete all, you can choose a few large deletions can be.
We can remove the log from the selection of a few 1G or so.
Second, restart MySQL
/etc/init.d/mysql restart
After the reboot, we'll look at the hard drive footprint.
Third, prohibit MySQL log
| The code is as follows |
Copy Code |
|
/etc/my.cnf
|
Edit this file, find Log-bin=mysql-bin and binlog_format=mixed two lines, before # comment out. Again, we restart MySQL to take effect.
In this way, we can resolve the MySQL log file caused by the hard drive is too large.