Home > Database > Mysql Tutorial > mysql主从日志的定期清理

mysql主从日志的定期清理

WBOY
Release: 2016-06-07 17:41:23
Original
1174 people have browsed it

mysql主从的binlog定时删除是很重要的,一般是通过expire_logs_days=10来设置binlog保留的天数(mysql5.0一下版本不支持),但有时这还不够,假如有几天的日志量

 mysql主从的binlog定时删除是很重要的,一般是通过expire_logs_days = 10来设置binlog保留的天数(mysql5.0一下版本不支持),但有时这还不够,服务器空间,假如有几天的日志量非常大,硬盘可能会满,美国空间,所以不但要设置保留的天数,还要监控硬盘的空间使用情况。写了一个脚本,适合各个版本的mysql,保留3天的日志,当存放日志的硬盘使用率超过80%,则保留2天,但至少会保留一天的binlog日志文件。

 

本文出自 “王伟” 博客,虚拟主机,请务必保留此出处

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template