如何清空MySQL日志文件

admin 提交于 周四, 05/14/2015 - 10:18

mysql运行久了会放很多日志文件在/var/lib/mysql下,每天几百M,很快会填满硬盘,可以用下面方法清空日志:

shell> mysql -u username -p
mysql> PURGE BINARY LOGS BEFORE '2009-05-01 00:00:00';

Reference: http://systems.takizo.com/2009/08/23/how-to-remove-mysql-binary-log/

标签

添加新评论

Restricted HTML

  • 允许的HTML标签:<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id> <img src>
  • 自动断行和分段。
  • 网页和电子邮件地址自动转换为链接。
验证码
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
请输入"汉语"