Bug #98898 max_binlog_size is not set to default
Submitted: 10 Mar 2020 20:48 Modified: 11 Mar 2020 17:43
Reporter: Brent Liu Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.7.29 OS:Ubuntu (16.04)
Assigned to: CPU Architecture:x86 (x86_64)
Tags: default value, max_binlog_size

[10 Mar 2020 20:48] Brent Liu
Description:
According to MySQL 5.7 reference manual, default value of max_binlog_size is 1073741824 (1GB).
Actual default value of max_binlog_size set by MySQL 5.7.29 is 104857600 (100MB).

How to repeat:
Don't define max_binlog_size in MySQL's configuration file i.e. /etc/mysql/mysql.cnf.
Start or re-start MySQL server.
Run "show global variables like 'max_binlog_size';" and it returns 104857600.
Also, a new binlog file is created once the current binlog file reaches around 100MB.

Suggested fix:
Make the default value of max_binlog_size to 1073741824.
[10 Mar 2020 22:40] MySQL Verification Team
Not a bug.  You've simply got a my.cnf somewhere on the system that's getting 
read.

I started my server like :

$ ./bin/mysqld --no-defaults --console  --basedir=. --datadir=./data 

mysql> show global variables like 'max_binlog_size';
+-----------------+------------+
| Variable_name   | Value      |
+-----------------+------------+
| max_binlog_size | 1073741824 |
+-----------------+------------+
1 row in set (0.00 sec)

mysql> select version();
+---------------------------------------+
| version()                             |
+---------------------------------------+
| 5.7.29-enterprise-commercial-advanced |
+---------------------------------------+
1 row in set (0.00 sec)
[10 Mar 2020 22:41] MySQL Verification Team
Refer: https://dev.mysql.com/doc/refman/5.7/en/option-files.html
[11 Mar 2020 17:43] Brent Liu
Hi Shane,
Thanks for looking into it.
You are right.  The MySQL's configuration file which comes with Ubuntu has two lines of include that reference other config directories. After removing those two lines of include and restarted MySQL, the default max_binlog_size was set correctly to 1G.
Ticket can be closed.