Today, I saw that a website under a VPS that installed the LNMP environment could not be opened. At the same time, the database could not be linked. Through df - hl, I checked that the hard disk occupied 100%. It seems that the disk occupation is the cause.Without special circumstances, the default installation of the LNMP one click package environment does not close the MYSQL log, which will result in the generation of mysql-bin.0000 * log files. If the website runs initially, it may not be found a problem, and it will occupy the hard disk after a long time.
First, log file address
/usr/local/mysql/var/
In the above folder, there are several megabytes to several gigabytes. We should not rush to delete them all, but we can select several large ones. We can delete some 1G logs selected.
Second, restart MYSQL
/etc/init.d/mysql restart
After restarting, let's take a look at the hard disk usage.
Third, prohibit MYSQL logs
/etc/my.cnf
Edit the file, find the log bin=mysql bin and binlog_format=mixed lines, and comment out the # above.Similarly, we restart MYSQL to take effect. In this way, we can solve the problem of excessive hard disk occupation caused by MYSQL log files.