Skip to content

Binary log settings by server

Server Binary log Row format How long binlog files are kept log_bin_trust_function_creators Where to set it
MySQL 8.0 and later On by default ROW by default binlog_expire_logs_seconds, 30 days by default Off by default The configuration file: Turn on the binary log
MySQL 5.7 and earlier Off by default: set log-bin and server-id ROW by default from MySQL 5.7.7 expire_logs_days Off by default The configuration file
MariaDB Off by default: set log-bin MIXED by default: set ROW expire_logs_days Off by default The configuration file
Amazon RDS for MySQL or MariaDB On when automated backups are on Set in a DB parameter group binlog retention hours Set in the parameter group Amazon Aurora MySQL and Amazon RDS
Amazon Aurora MySQL Off until binlog_format is set Set in a DB cluster parameter group binlog retention hours Set in the parameter group Amazon Aurora MySQL and Amazon RDS
Azure Database for MySQL - Flexible Server Always on Always ROW binlog_expire_logs_seconds, 0 by default On by default Azure Database for MySQL
Google Cloud SQL for MySQL On when binary logging is on for the instance Check with the query in Turn on the binary log See Google Cloud's documentation A database flag Google Cloud SQL for MySQL

Remove binlog files yourself

To remove binlog files sooner than the server does, look up the file the agent is reading in its log position on the Summary tab, and remove only older files. This removes the files before mysql-bin.000007, not that file:

PURGE BINARY LOGS TO 'mysql-bin.000007';