Skip to content

MySQL binary logging configuration

MySQL binary logging configuration involves specific variables within the MySQL configuration file (typically my.ini or my.cnf) that control the size, synchronization, and format of binary logs, which are essential for data recovery and replication.^[600-developer-database-mysql-mysql8-portable.md]

Key Configuration Variables

  • binlog_row_event_max_size: Specifies the maximum size (in bytes) for row-based binary log events.^[600-developer-database-mysql-mysql8-portable.md] If possible, rows are split into events smaller than this limit, and the value should be a multiple of 256.^[600-developer-database-mysql-mysql8-portable.md]
  • sync_master_info: Controls the frequency of synchronizing the master.info file to disk.^[600-developer-database-mysql-mysql8-portable.md] If set to a value greater than 0, the file is synchronized (using fdatasync()) after every sync_master_info event.^[600-developer-database-mysql-mysql8-portable.md]
  • sync_relay_log: Determines how often the relay log is synchronized to disk.^[600-developer-database-mysql-mysql8-portable.md] When set greater than 0, synchronization occurs after every sync_relay_log write to the relay log.^[600-developer-database-mysql-mysql8-portable.md]
  • sync_relay_log_info: Manages the synchronization of the relay-log.info file to disk.^[600-developer-database-mysql-mysql8-portable.md] A value greater than 0 triggers synchronization after every sync_relay_log_info transaction.^[600-developer-database-mysql-mysql8-portable.md]
  • [[InnoDB configuration]]
  • [[MySQL replication]]
  • [[Data recovery]]

Sources

^[600-developer-database-mysql-mysql8-portable.md]