MySQL disk space is not enough to check the row

Source: Internet
Author: User
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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.