Tuesday, May 7, 2024
 Popular · Latest · Hot · Upcoming
12
rated 0 times [  12] [ 0]  / answers: 1 / hits: 20946  / 3 Years ago, tue, june 8, 2021, 11:33:58

MySQL Binlog files count is increasing day by day and their size is increasing in gigabytes. How can I stop the increasing size of binlog files? They are fulling the disc space.


More From » mysql

 Answers
0

If you do not need to keep those binary logs, you can “trim” them within MySQL like this:


mysql> PURGE BINARY LOGS BEFORE '2021-01-01 00:00:00';

Of course, you can change the date to whenever you would like. If you would like to trim to a specific binary log file, you can do it like this:


mysql> PURGE BINARY LOGS TO 'mysql-bin.12345';

Be sure to specify the actual file you are trimming to.


IMPORTANT: Do not simply delete the files from the file system. MySQL will complain at some time in the future in a terrible fashion. Save yourself the unnecessary downtime by using PURGE BINARY LOGS command from within MySQL.


[#1838] Wednesday, June 9, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
defendle

Total Points: 219
Total Questions: 131
Total Answers: 112

Location: Finland
Member since Sat, Nov 6, 2021
3 Years ago
defendle questions
Mon, May 10, 21, 03:46, 3 Years ago
Mon, Dec 5, 22, 07:16, 1 Year ago
Tue, Jun 21, 22, 13:49, 2 Years ago
;