MySQLã§ãã¤ããªãã°ãå®æçã«åé¤ãã
MySQLãå
¥ãã¦ããµãã®ãã¤ããªãã°ãè¥å¤§åãã¦ãã£ã¹ã¯ãã«ãå¼ãèµ·ãããã®ã§å¯¾å¿ã¡ã¢
expire_logs_daysã®è¨å®ããã¦ããã°OKãããã
調ã¹ãã°ãããã§ãæ
å ±åºã¦ãããã©ããã®è¾ºã£ã¦ä¸åº¦åé¡ã«ç´é¢ããªãã¨æ°ä»ããªããã ããªã¼ã»ã»ã»
- OS
- CentOS 5.8
- MySQL
- ãã¼ã¸ã§ã³ 5.5
- ã¤ã³ã¹ãã¼ã«ãã£ã¬ã¯ããªã¨ãã¯ããã©ã«ãã®ã¾ã¾
ããã©ã«ãã®è¨å®ç¢ºèª
expire_logs_days=0ãããã©ã«ãã§ããã®å ´åã¯ãã¤ããªãã°ã®åé¤ã¯è¡ããªãã
å®éã«ãµãã§ç¢ºèªãã¦ã¿ãã¨ç¢ºãã«0ã ã£ãã
mysql> show global variables like 'expire_logs_days'; +------------------+-------+ | Variable_name | Value | +------------------+-------+ | expire_logs_days | 0 | +------------------+-------+ 1 row in set (0.00 sec)
expire_logs_daysãè¨å®ãã
ä»åã¯my.confã«ç´æ¥è¨å®ãæ¸ãã¦MySQLãåèµ·åããã
ä»åã¯30æ¥åã®binlogãä¿åããããã«ããã
$ diff my.cnf my.cnf.org 5d4 < expire_logs_days=30
åèµ·åå¾ã«ç¢ºèªãã¦ã¿ãã¨ãå¤æ´ããã¦ãã
èµ·åæã«ãã¤ããªãã°ã®æ´çããã£ã¦ããã模æ§ããã£ã¹ã¯ãããã¶ããã£ãããã¦ã¦ãããã¼ã«ãªã£ãã
mysql> show global variables like 'expire_logs_days'; +------------------+-------+ | Variable_name | Value | +------------------+-------+ | expire_logs_days | 30 | +------------------+-------+ 1 row in set (0.00 sec)
â»åèµ·åããªãå ´åã以ä¸ã§ç´æ¥expire_logs_dayså¤æ´ã§ãã
ãã®å ´åãMySQLãåèµ·åããã¨å¤ãããã©ã«ãã«æ»ã£ã¦ãã¾ãã®ã§æ³¨æ
mysql> SET GLOBAL expire_logs_days = 30;