Intro
This is actually an upstream change. Some distributions might change the setting back, but it is likely that most will just follow upstream.
The codebase is hosted on https://github.com/mysql/mysql-server
The actual file where binary logging is made default ON, is
sql/sys_vars.cc
Digging through the blames, eventually I nailed down the commit that changed the default:
https://github.com/mysql/mysql-server/commit/9fa9504e5aaf68661aef2d735cecbd3c58eb7790
It mentions a Worklog Item for the mysql team: #10470.
You can look them up here: https://dev.mysql.com/worklog/
The Rationale section of that Worklog item offers this:
Rationale
Nearly all production installations have the binary log enabled as it's used
for replication and point-in-time recovery.
Given that, we should have it enabled by default for the following reasons:
- We eliminate one configuration step for users.
1A. Enabling it later requires a mysqld restart.
- We get more production-like internal testing of the server.
- We can better know and face the performance impact of the binary log
Expiration
In mysql 8.0 the default expiration for logfiles is 30 days
, governed by the variable binlog_expire_logs_seconds
, which defaults to 2592000 seconds
. For a purge to actually occur, there has to be a flushing of the logs. According to the documentation a log flush automatically happens when one binary log file is closed and a new one started. The maximum size of individual files can be governed by max_binlog_size
which is max 1GB. However there is a caveat that transactions are not split across log files, and they could theoretically be up to 4GB. You could also issue a flush logs
or a purge binary logs
statement daily yourself.