# View log file error message
[root@VM-16-2-centos local]# cat /data/mysql-data/ |grep 'ERROR'
2024-07-08T03:00:49.368924Z 0 [ERROR] [MY-000067] [Server] unknown variable 'expire_logs_days=20'.
2024-07-08T03:00:49.370590Z 0 [ERROR] [MY-010119] [Server] Aborting
2024-07-08T03:00:55.287583Z 0 [ERROR] [MY-000067] [Server] unknown variable 'expire_logs_days=20'.
2024-07-08T03:00:55.288511Z 0 [ERROR] [MY-010119] [Server] Aborting
# Delete the configuration of the log expiration time of the configuration file, or reset the log expiration time
[root@VM-16-2-centos local]# /usr/local/mysql/bin/mysqld --help --verbose |grep expire
--binlog-expire-logs-auto-purge
(Defaults to on; use --skip-binlog-expire-logs-auto-purge to disable.)
--binlog-expire-logs-seconds=#
binlog_expire_logs_seconds seconds; Purges happen at
The number of days after which the password will expire.
--disconnect-on-expired-password
(Defaults to on; use --skip-disconnect-on-expired-password to disable.)
with a random expired password and store it into the log.
The timeout to expire sessions in the TLS session cache
binlog-expire-logs-auto-purge TRUE
binlog-expire-logs-seconds 2592000
disconnect-on-expired-password TRUE
[root@VM-16-2-centos local]#
# You can see that the binlog expiration time is set to binlog-expire-logs-seconds, and there is a default value, the unit is seconds
vi /etc/
#Set the expiration time of binlog to 20 days
binlog-expire-logs-seconds=1728000