# 查看日志文件的错误信息
[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
# 删除配置文件的日志过期时间的配置,或者重新设置日志过期时间
[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]#
# 可以看到binlog过期时间的设置是binlog-expire-logs-seconds,并且有默认值,单位是秒
vi /etc/
#设置binlog的过期时间是20天
binlog-expire-logs-seconds=1728000