Server log maintenance
To maintain log files, we must clean up on a regular basis to manage disk space. For RPM based Linux systems the mysql-log-rotate script is available automatically. For other systems no such script is available, so we must install a short script by ourselves to manage log files. MySQL 8 provides the expire_logs_days system variable which is used to manage binary log files. Using this variable log Binary log files are automatically removed after a specified period.
The default value of this variable is 30 days; you can change its value by configuration change. Binary log files are remove on server startup or when the log is flushed. In case of replication, you can also use the binlog_expire_logs_seconds system variable ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access