patternsqlMinor
why my MySQL binary log file size is so small?
Viewed 0 times
whyfilelogsizemysqlbinarysmall
Problem
I have a lot of small binary log files , each of them just only 126 Bytes
how to let them grow bigger? and my "binlog_cache_size" is more than 126 Byte
can anybody tell me why(⊙ˍ⊙) ? thank you very much :)
mysql logging
-rw-rw----. 1 mysql mysql 126 Jan 6 16:13 mysql-bin.000001
-rw-rw----. 1 mysql mysql 126 Jan 6 16:16 mysql-bin.000002
-rw-rw----. 1 mysql mysql 150 Jan 7 10:34 mysql-bin.000003
-rw-rw----. 1 mysql mysql 126 Jan 8 09:57 mysql-bin.000004
-rw-rw----. 1 mysql mysql 126 Jan 8 11:08 mysql-bin.000005
-rw-rw----. 1 mysql mysql 107 Jan 8 11:09 mysql-bin.000006
-rw-rw----. 1 mysql mysql 126 Jan 8 13:21 mysql-bin.000007
-rw-rw----. 1 mysql mysql 342 Jan 8 16:25 mysql-bin.indexhow to let them grow bigger? and my "binlog_cache_size" is more than 126 Byte
mysql> show variables like 'binlog_cache_size';
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 1
Current database: test
+-------------------+-------+
| Variable_name | Value |
+-------------------+-------+
| binlog_cache_size | 32768 |
+-------------------+-------+
1 row in set (0.00 sec)can anybody tell me why(⊙ˍ⊙) ? thank you very much :)
mysql logging
Solution
Is your MySQL Server restarting? Check your uptime:
SHOW GLOBAL STATUS LIKE 'uptime';
The binary log gets closed at shutdown, and a new binary log created at startup. The fact that you get "MySQL server has gone away" while querying above might also suggest the server restarted.
SHOW GLOBAL STATUS LIKE 'uptime';
The binary log gets closed at shutdown, and a new binary log created at startup. The fact that you get "MySQL server has gone away" while querying above might also suggest the server restarted.
Context
StackExchange Database Administrators Q#125717, answer score: 2
Revisions (0)
No revisions yet.