(已解決)ERROR 3683 (HY000): The option expire_logs_days and binlog_expire_logs_seconds cannot be used

  • 問題描述

    設置expire_logs_days參數出現如下問題:

    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)
    
  • 解決方案

    這個參數的意思是設置日誌失效日期爲3天,默認是30天,比較耗費磁盤空間。

    這個參數已經棄用, 改用binlog_expire_logs_seconds ,單位由改爲,如下設置1天。

    set global binlog_expire_logs_seconds=60*60*24;

    可以通過show variables like '%expire%';查看更改結果。

    永久改動可以找到/etc/mysql/my.cnfUbuntu)文件寫入配置。

  • References

  1. MySQL 8.0.12 binlog參數binlog_expire_logs_seconds
  2. Is it safe to delete mysql-bin files?
  3. How do I find the MySQL my.cnf location
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章