The hard disk is full, mysql

888u

Last update at :2023-12-25,Edit by888u

When this site was still using Tencent Cloud host, a problem arose: the default 8G capacity was really not enough, and the hard drive was full in less than a day. The reason for this was that the Mysql log was turned on, and It has something to do with the program! When the hard disk is full, it can be said that the website cannot be opened. At this time, we need to perform some operations!

Log in to the terminal to check file input greater than 100MB:

find / -size +100M -exec ls -lh {} \;

According to the prompts, it is found that it is indeed a log file! Just clear it. Please do not delete it directly to avoid unnecessary trouble. Delete all mysql-bin.0000* log files, restart and it will be OK, and then turn off the mysql logging function.

How to turn off MySQL’s logging function:

Here is Brother Jun’s one-click installation package as an example, and the rest can be modified according to your own style! Please note that if the host provider provides backup services, it is recommended to back up first, just in case!

Delete log:

Execute:

/usr/local/mysql/bin/mysql -u root -p

Enter the password of the database root user to log in and then execute: xxxx xxxxxxxx;

Enter: quit to exit the mysql command mode.

Completely disable MySQL logs: modify the /etc/my.cnf file and find it

log-bin=mysql-bin
binlog_format=mixed

Add # in front of these two lines, comment them out, and then execute /etc/init.d/mysql restart.

If you really want to keep the logs, you can add expire_logs_days = 5 to /etc/my.cnf and then restart mysql, so that the logs will be automatically cleared after 5 days. It is recommended to set it to 3-7 days. If the data is large, it is recommended to automatically clean it every 2 days!

Recommended site search: Hong Kong host, domain name registration information query Korean independent server, dual-line host rental, server, Hong Kong server rental 99idc, Taiwan server, free cn domain name registration, personal virtual host, registration query,

The hard disk is full, mysql

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