The supervisor told me today that there is not enough disk space on the MySQL server, just log in to the server to view:
Command: DF-LH
accounted for 99%.
was not cached.
Enter >mysql
Flush logs; Nothing has changed.
Let's see which directory takes up space.
CD/
DU-LH--max-depth=1
Found a./var directory with 37G
CD./var
DU-LH--max-depth=1
Locate the Lib directory
Again
cd Lib
Find MySQL Directory
CD MySQL
Ls-al
More than 30 mysql.bin ... Files, each with more than 1G, turns out to be some bin log files.
Because this MySQL does the master-slave copy, this one is the primary server.
The resulting bin file remains, and the more it takes.
Modify MY.CNF, Set bin file save time to 3 days
Vi/etc/my.cnf
Add a sentence:
Expire_logs_days=3
Restart the server, just fine!
From the original used space 99%, the remaining 794M, immediately become 17%, the remaining 35G!
Finally easy down!
Thank you for reading! Hope to help you!
Welcome to join the PHP technical question and answer group, QQ group number: 292626152, we help each other and grow together!
Refer to the article:
MySQL master-slave log file Mysql-bin file Cleanup method
52858946
MySQL disk space is not enough to check the row