Solve LNMP environment mysql

888u

Last update at :2024-06-25,Edit by888u

Today I saw that a website under a VPS with LNMP environment installed could not be opened. At the same time, there was also a problem that the database could not be linked. I used df -l to check that the hard disk usage was 100%. It seemed that it was caused by disk usage. Unless there are special circumstances, the default installed 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 is running in the early stages, the problem may not be discovered, and the hard disk will be occupied over time.

First, log file address

/usr/local/mysql/var/

In the above folder, there are several M to several G. We should not rush to delete them all. We can select a few large ones to delete.

We can just delete a few selected logs of about 1G.

Second, restart MYSQL

/etc/init.d/mysql restart

After restarting, let’s take a look at the hard disk usage.

Third, disable MYSQL logs

/etc/my.cnf

Edit this file and find the two lines log-bin=mysql-bin and binlog_format=mixed. Just comment out the # in front of them. Similarly, we restart MYSQL to take effect.

In this way, we can solve the problem of excessive hard disk usage caused by MYSQL log files.

Recommended site search: check IP address, permanent registration-free cloud server recommendation in mainland China, buy high-defense server, Taiwan server, free all-purpose space application, php virtual space, registration password retrieval, IP detailed address query, query domain name, Mainland China virtual host,

Solve LNMP environment mysql

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码