expire_logs_days
来源:互联网 发布:数据正态分布含义 编辑:程序博客网 时间:2024/05/17 03:07
expire_logs_days
设置完这个参数之后需要执行flush logs
The number of days for automatic binary log file removal. The default is 0, which means “no automatic removal.” Possible removals happen at startup and when the binary log is flushed. Log flushing occurs as indicated in Section 5.2, “MySQL Server Logs”.
To remove binary log files manually, use the PURGE BINARY LOGS statement. See Section 12.5.1.1, “PURGE BINARY LOGS Syntax”.
In addition, the binary log is flushed when its size reaches the value of the max_binlog_size system variable.
max_binlog_size
If a write to the binary log causes the current log file size to exceed the value of this variable, the server rotates the binary logs (closes the current file and opens the next one). The minimum value is 4096 bytes. The maximum and default value is 1GB.
You might face sutch a problem if the mysql-bin.index file is no longer matching the reality (for exemple, if you manually deleted logs files).
cat your /var/log/mysql/mysql-bin.index (or whatever your .index file is), it is a text file that contains the names of all used binary log files. There shouldn't be a difference between its content and the list of log files on your filesystem.
You might try this (changing the paths according to your configuration) :
# /bin/ls -1 /var/log/mysql/mysql-bin.[0-9]* | diff /var/log/mysql/mysql-bin.index -
If there is a difference, try this :
- stop your mysql server
- backup your mysql-bin.index file
- re-create a file with the logs that still exists
- start your mysql server
Example (again, you might change the paths according to your own configuration) :
# /etc/init.d/mysql stop
# cd /var/log/mysql
# cp mysql-bin.index mysql-bin.index-
# ls -1 /var/log/mysql/mysql-bin.[0-9]* > mysql-bin.index
# /etc/init.d/mysql start
- expire_logs_days
- expire_logs_days
- expire_logs_days具体示例
- mysql问题:using expire_logs_days without log_bin crashes the server...
- winform 分页控件
- Axis2
- 2010.5.1休息2010.5.2逛书店
- dmalloc 原文 翻译整理(2)
- STL算法学习[转载]
- expire_logs_days
- The First Blog
- Forms验证
- 浪潮之颠读后感
- 关于环境变量的顺序问题
- 2010.5.3 设计模式
- HBase源代码分析1 - Row Lock
- 未能加载文件或程序集“vjslib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”或它的某一个依赖项。系统找不到指定的文件。
- JIOPi v0.1 概述