write down,forget
adidas eqt support ultra primeknit vintage white coming soon adidas eqt support ultra boost primeknit adidas eqt support ultra pk vintage white available now adidas eqt support ultra primeknit vintage white sz adidas eqt support ultra boost primeknit adidas eqt adv support primeknit adidas eqt support ultra boost turbo red white adidas eqt support ultra boost turbo red white adidas eqt support ultra boost turbo red adidas eqt support ultra whiteturbo adidas eqt support ultra boost off white more images adidas eqt support ultra boost white tactile green adidas eqt support ultra boost beige adidas eqt support ultra boost beige adidas eqt support refined camo drop adidas eqt support refined camo drop adidas eqt support refined running whitecamo adidas eqt support 93 primeknit og colorway ba7506 adidas eqt running support 93 adidas eqt support 93

mysql-bin.000001-x

<Category: Linux, mysql> 查看评论

发达了,-bin占了我9g空间啊,大汗一把:
20K .000001
700K mysql-bin.000002
4.0K mysql-bin.000003
4.0K mysql-bin.000004
4.0K mysql-bin.000005
4.0K mysql-bin.000006
4.0K mysql-bin.000007
4.0K mysql-bin.000008
4.0K mysql-bin.000009
4.0K mysql-bin.000010
11M mysql-bin.000011
63M mysql-bin.000012
368K mysql-bin.000013
256K mysql-bin.000014
9.5M mysql-bin.000015
1.8M mysql-bin.000016
11M mysql-bin.000017
508K mysql-bin.000018
45M mysql-bin.000019
146M mysql-bin.000020
86M mysql-bin.000021
2.2M mysql-bin.000022
2.6M mysql-bin.000023
124K mysql-bin.000024
8.7M mysql-bin.000025
4.9M mysql-bin.000026
428K mysql-bin.000027
372K mysql-bin.000028
123M mysql-bin.000029
17M mysql-bin.000030
4.0K mysql-bin.000031
700K mysql-bin.000032
454M mysql-bin.000033
14M mysql-bin.000034
841M mysql-bin.000035
388M mysql-bin.000036
26M mysql-bin.000037
728K mysql-bin.000038
216M mysql-bin.000039
228M mysql-bin.000040
294M mysql-bin.000041
14M mysql-bin.000042
155M mysql-bin.000043
13M mysql-bin.000044
884K mysql-bin.000045
13M mysql-bin.000046
434M mysql-bin.000047
206M mysql-bin.000048
171M mysql-bin.000049
528K mysql-bin.000050
61M mysql-bin.000051
330M mysql-bin.000052
199M mysql-bin.000053
64M mysql-bin.000054
436K mysql-bin.000055
17M mysql-bin.000056
340K mysql-bin.000057
116M mysql-bin.000058
18M mysql-bin.000059
23M mysql-bin.000060
188M mysql-bin.000061
40K mysql-bin.000062
277M mysql-bin.000063
4.0K mysql-bin.000064
35M mysql-bin.000065
258M mysql-bin.000066
147M mysql-bin.000067
79M mysql-bin.000068
4.0K mysql-bin.000069
4.0K mysql-bin.000070
434M mysql-bin.000071
4.0K mysql-bin.000072
99M mysql-bin.000073
52M mysql-bin.000074
620K mysql-bin.000075
428M mysql-bin.000076
788K mysql-bin.000077
4.0K mysql-bin.000078
4.0K mysql-bin.000079
126M mysql-bin.000080
137M mysql-bin.000081
428K mysql-bin.000082
31M mysql-bin.000083
4.0K mysql-bin.index

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

这样做主要有以下两个目的:
1:数据恢复
如果你的数据库出问题了,而你之前有过备份,那么可以看日志文件,找出是哪个命令导致你的数据库出问题了,想办法挽回损失。

2:主从服务器之间同步数据
主服务器上所有的操作都在记录日志中,从服务器可以根据该日志来进行,以确保两个同步。

处理方法分两种情况:
1:只有一个mysql服务器,那么可以简单的注释掉这个选项就行了。
vi /etc/my.cnf把里面的 log-bin 这一行注释掉,重启mysql服务即可。

2:如果你的环境是主从服务器,那么就需要做以下操作了。
A:在每个从属服务器上,使用SHOW SLAVE STATUS来检查它正在读取哪个日志。
B:使用SHOW MASTER LOGS获得主服务器上的一系列日志。
C:在所有的从属服务器中判定最早的日志,这个是目标日志,如果所有的从属服务器是更新的,就是清单上的最后一个日志。
D:清理所有的日志,但是不包括目标日志,因为从服务器还要跟它同步。

清理日志方法为(任意):
mysql>reset master;
mysql>PURGE MASTER LOGS TO ‘mysql-bin.010’;
mysql>PURGE MASTER LOGS BEFORE ‘2008-12-19 21:00:00’;
或者/etc/my.conf加个参数,限制保存的天数:
expire_logs_day=20

如果你确定从服务器已经同步过了,跟主服务器一样了,那么可以直接 RESET MASTER 将这些文件删除。

注意,有的mysql版本不能把记录文件全部删除,否则会导致phpmyadmin读取不到mysql数据,例如我用的mysql5.1.33版本,只能删除旧的记录文件,但是无论如何要保留最后一个记录文件。

本文来自: mysql-bin.000001-x