Announcement

Announcement Module
Collapse
No announcement yet.

Clarification on Mysql dynamic variable "expire_logs_days"

Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Clarification on Mysql dynamic variable "expire_logs_days"

    We have Mysql running 5.5.25 and "expire_logs_days" is by default '0'. We have purged the logs using the command
    PURGE BINARY LOGS TO 'mysql-bin.xxxxxx';. Plan to enable auto purge of mysql bin logs so I set the variable to retain the last 14 days logs as SET GLOBAL expire_logs_days=14. My question is do we need to add this parameter expire_logs_days in my.cnf, if so why? Having said that it is a global parameter it does not require to be added in my.cnf. If it is mandatory to add in my.cnf, do we need to restart the mysql instance to have the changes affective or just add in my.cnf and also set in variables without restarting the instance. Please suggest!!

  • #2
    expire_logs_days is dynamic variable and it's value can be set without restarting MySQL however, if server restarts expire_log_days value will be reset and your changes will be lost. In order to make change permanent you can also add it in my.cnf and whenever mysql restarts it value will be persist which you already set previously without restarting via SET GLOBAL expire_log_days=14 You can read more about it here http://dev.mysql.com/doc/refman/5.5/...pire_logs_days

    Hope that helps.

    Comment


    • #3
      Thanks for clarifying Irfan.

      Comment

      Working...
      X