删除 MySQL binlog

BBigSun 评论375阅读模式

注意

binlog 文件不能直接使用 rm 命令删除,就算直接删除,空间释放了,但在 mysql-bin.index 档案中仍有记录

操作步骤

1、进入 mysql binlog 目录下,查看 binlog 具体时间文章源自十年又十年-https://www.bbigsun.com/474.html

ll mysql-bin.*

删除 MySQL binlog文章源自十年又十年-https://www.bbigsun.com/474.html

2、登录 mysql文章源自十年又十年-https://www.bbigsun.com/474.html

查看 binlog:文章源自十年又十年-https://www.bbigsun.com/474.html

show binary logs;

删除 binlog:(删除 5月1号 日期之前的 binlog)文章源自十年又十年-https://www.bbigsun.com/474.html

purge binary logs to 'mysql-bin.001409';

再次查询 binlog:(验证是否删除成功)文章源自十年又十年-https://www.bbigsun.com/474.html

show binary logs;
文章源自十年又十年-https://www.bbigsun.com/474.html文章源自十年又十年-https://www.bbigsun.com/474.html

纸上得来终觉浅,绝知此事要躬行。

weinxin
17688689121
我的微信
微信扫一扫
MySQL最后更新:2024-5-11
BBigSun
  • 本文由 BBigSun 发表于 2023年 5月 2日 10:26:53
  • 转载请务必保留本文链接:https://www.bbigsun.com/474.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定