目录
一. 在线修改,即时生效
mysql> show variables like '%expire%';
+--------------------------------+---------+
| Variable_name | Value |
+--------------------------------+---------+
| binlog_expire_logs_auto_purge | ON |
| binlog_expire_logs_seconds | 2592000 |
| disconnect_on_expired_password | ON |
| expire_logs_days | 0 |
+--------------------------------+---------+
4 rows in set (0.02 sec)
mysql> set global expire_logs_days=1;
ERROR 3683 (HY000): The option expire_logs_days and binlog_expire_logs_seconds cannot be used together.
Please use binlog_expire_logs_seconds to set the expire time (expire_logs_days is deprecated)
mysql> set global binlog_expire_logs_seconds=86400;
Query OK, 0 rows affected (0.00 sec)
mysql> show variables like