Home >Database >Mysql Tutorial >处理Mysql的MySql-bin.0000X日志文件_MySQL

处理Mysql的MySql-bin.0000X日志文件_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-01 13:47:191088browse

bitsCN.com

mysql运行一段时间后,在mysql目录下出现一堆类似 mysql-bin.000***,从mysql-bin.000001开始一直排列下来,而且占用了大量硬盘空间,高达几十个G.  对于这些超大空间 占用量的文件我们应该怎么办呢?
      首先咱们来分析下mysql数据库文件夹中的mysql-bin.00001是什么文件?

mysql-bin.000001、mysql- bin.000002等文件是数据库的操作日志,例如UPDATE一个表,或者DELETE一些数据,即使该语句没有匹配的数据,这个命令也会存储到日志 文件中,还包括每个语句执行的时间,也会记录进去的。

  任何处理呢?

/usr/local/mysql/bin/mysql -u root -p

输入密码登陆mysql后,运行命令:
reset master;

(完)

 

bitsCN.com
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn