Last update at :2024-06-28,Edit by888u
If we use the AMH panel or the LNMP one-click installation package environment, we will encounter such a problem. Most novice users may install the environment directly using the official one-click package command and then start building the website. However, as time goes by, some users will find that the website cannot be opened one day, and then check the resources and find that the VPS hard disk is full. Most of them are not caused by the excessive content of our website, but by the MYSQL-BIN database log occupation. Caused by the hard drive.
In the article "Solving the resource occupation problem of the mysql-bin.0000* log in the LNMP environment and closing the Mysql log\\", Snail shared the original LNMP environment when the hard disk of the website was blocked by the database about a year ago. How to solve the problem of full cache resources. Here I want to share the AMH panel (free version 4.2) and the solution to the excessive resource usage of MYSQL-BIN.
We can see that in just a few hours on the 31st, the cache resources occupied several gigabytes. If this continues, the basic VPS hard drive will be full in just a few hours or 2 days. We definitely need to solve this problem.
First, clean up the existing MYSQL-BIN file
It is best not to delete it directly, as it may cause the problem that MYSQL cannot be started. Instead, use the following method. After logging in to SSH, enter:
mysql -u root -p
Then enter the database password, then enter:
reset master;
In this way, all our cached MYSQL-BIN will be cleared.
Second, limit the generation of MYSQL-BIN
Cache files are still useful. They can be used to restore data in case there is a problem with MYSQL. We only need to do regular maintenance. But if you absolutely need to prohibit its generation, then we can do the following.
Find the file in /etc/my.cnf, and then comment the 20 lines of log-bin = mysql-bin with # to update the server file.
Third, restart the AMH panel MYSQL
amh mysql restart
Enter the above command and restart MYSQL to solve the problem we need.
To summarize, generally when we use the AMH panel or LNMP, most users will not deal with these problems. They will only find someone to solve them when the website cannot be opened and the data disk is full. After reading the method in this article, even if we don't solve the problem or do regular maintenance at first, we can learn to solve the problem of MYSQL-BIN occupying the hard disk by ourselves after encountering the problem.
Recommended site search: Hong Kong cloud host, Taiwan server, overseas host, Korean server rental, registration number query, US host purchase, station group server rental, me domain name, ip proxy free version 2.80, Hong Kong server recommendation,
发表评论