Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Checking and troubleshooting of insufficient disk space in mysql

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Today, my supervisor told me that there was not enough disk space on the mysql server. I just logged in to the server to check:

Command: df-lh

Accounted for 99%.

Is it cached.

Enter > mysql

Flush logs; hasn't changed much.

Let's see which directory takes up space.

Cd /

Du-lh-- max-depth=1

Found that the. / var directory has 37G

Cd. / var

Du-lh-- max-depth=1

Find it is the lib directory

Again

Cd lib

Find the mysql directory

Cd mysql

Ls-al

More than 30 mysql.bin... Files, each with more than 1G, are originally some bin log files.

Because this mysql does master-slave replication, this is the master server.

The generated bin files are kept all the time, and more and more are occupied.

Modify my.cnf to set the saving time of bin file to 3 days

Vi / etc/my.cnf

Add:

Expire_logs_days=3

Just restart the server and it will be fine!

From the original used space 99%, the remaining 794m, immediately changed to 17%, the remaining 35g!

Finally relax!

Thank you for your reading! I hope it will help you!

Welcome to join the PHP technical question and answer group, QQ group number: 292626152, we help each other and grow together!

Please refer to the article:

Mysql master-slave log file mysql-bin file cleaning method

Https://blog.csdn.net/zhengfeng2100/article/details/52858946

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report