简体   繁体   English

MySQL binlog_expire_logs_seconds 不工作

[英]MySQL binlog_expire_logs_seconds not working

I have configured the database using SET GLOBAL binlog_expire_logs_seconds = 259200;我已经使用SET GLOBAL binlog_expire_logs_seconds = 259200;配置了数据库query to purge binary logs older then 3 days.查询以清除 3 天之前的二进制日志。 Using MySQL 8.0.22.使用 MySQL 8.0.22。 This does not seem to have any effect.这似乎没有任何效果。 bin logs are accumulating under /var/lib/mysq/dbname-bin.000xx files. bin 日志在 /var/lib/mysq/dbname-bin.000xx 文件下累积。 Executing执行

PURGE BINARY LOGS BEFORE '2020-.......' 

works, but I would like the DB engine to purge those logs on its own without myself calling it.有效,但我希望数据库引擎自行清除这些日志,而无需我自己调用它。 Otherwise binlogs take most of the disk space.否则 binlog 会占用大部分磁盘空间。 Please suggest.请建议。

I had the same problem (but on Windows 10), I edited my.ini located in c:/xampp/mysql/bin and added the following:我遇到了同样的问题(但在 Windows 10 上),我编辑了位于 c:/xampp/mysql/bin 的 my.ini 并添加了以下内容:

binlog_expire_logs_seconds=60

Does this work for you?这对你有用吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM