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

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 13:47:19
Original
1087 people have browsed it

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
Related labels:
source:php.cn
Statement of this Website
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
Latest Issues
MySQL stops process
From 1970-01-01 08:00:00
0
0
0
Error when installing mysql on linux
From 1970-01-01 08:00:00
0
0
0
phpstudy cannot start mysql?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template