Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 02 May 2008 17:58:06 +0200
From:      Zbigniew Szalbot <z.szalbot@lc-words.com>
To:        Chris Pratt <eagletree@hughes.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: handling mysql binlog data
Message-ID:  <481B3A0E.6060300@lc-words.com>
In-Reply-To: <4C629ECE-9203-4A3B-94FA-8BACEA07EE70@hughes.net>
References:  <481B08B2.7070702@lc-words.com> <4C629ECE-9203-4A3B-94FA-8BACEA07EE70@hughes.net>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
Hello,

Chris Pratt pisze:

> On May 2, 2008, at 5:27 AM, Zbigniew Szalbot wrote:
> 
>> Hello,
>>
>> Following a recent thread I would like to ask if it is safe to  
>> remove old binlog data. From the below I understand that the  
>> current binlog is mysql-bin.000007 and the previous ones (from  
>> 000001-000006) are not written to any more. I just need  
>> confirmation before I take any action. By asking whether it is  
>> safe, I only mean if deleting them will not affect mysql operation.  
>> I do backups of mysql data anyway.
>>
>> -rw-rw----  1 mysql  mysql    61956466 Apr 16 08:44 mysql-bin.000001
>> -rw-rw----  1 mysql  mysql   697756219 Apr 17 14:26 mysql-bin.000002
>> -rw-rw----  1 mysql  mysql        1056 Apr 17 14:29 mysql-bin.000003
>> -rw-rw----  1 mysql  mysql  1073745860 Apr 24 05:49 mysql-bin.000004
>> -rw-rw----  1 mysql  mysql   620489997 Apr 27 10:48 mysql-bin.000005
>> -rw-rw----  1 mysql  mysql   229357379 Apr 28 15:55 mysql-bin.000006
>> -rw-rw----  1 mysql  mysql   869964294 May  2 14:15 mysql-bin.000007
>>
>> Do I understand correctly that removing mysql-bin.000007 would  
>> result in mysql not writing any data to mysql-bin file until the  
>> server gets restarted?
>>
> 
> I recently removed all logs prior to the one shown as current
> without any problems. I would not think you would want to
> remove the one currently in use or problems would result.
> 
> The procedure for this is here:
> http://dev.mysql.com/doc/refman/5.1/en/purge-master-logs.html
> for 5.1 and here:
> http://dev.mysql.com/doc/refman/5.0/en/purge-master-logs.html
> for 5.0

Thanks a lot! It did help me get rid of a few files in a safe way. I 
only wonder now how to set up a cron job to do it on a permanent basis?

1/ I would probably be better off setting this mysql query (URGE {MASTER 
| BINARY} LOGS BEFORE 'date') in a separate file an run it from cron?

2/ Even if I do that, I would still have to change the 'date' value each 
month... hmm... as non-programmer I will probably do best to simply 
enter a task in a calendar to run this manually... each month :)

Thank you anyway - this was very helpful and I instantly saved a lot of 
space on a shrinking /var partition!

-- 
Zbigniew Szalbot
www.lc-words.com

[-- Attachment #2 --]
0	*H
010	+0	*H
0b0ˠ{KL/GY`0
	*H
0b10	UZA1%0#U
Thawte Consulting (Pty) Ltd.1,0*U#Thawte Personal Freemail Issuing CA0
080426152039Z
090426152039Z0H10UThawte Freemail Member1%0#	*H
	z.szalbot@lc-words.com00
	*H
0rep%'#Ouu);3Q{e摶y EU<>._$u}j_yӚMfO|y\=h!bTKky3	
.d?ge(zz3010!U0z.szalbot@lc-words.com0U00
	*H
wm_Uϩ^C{cdl8j*?)zLLoZ~h:b3
CjRm6?JqL/jA02&yG(	Q[$f060b0ˠ{KL/GY`0
	*H
0b10	UZA1%0#U
Thawte Consulting (Pty) Ltd.1,0*U#Thawte Personal Freemail Issuing CA0
080426152039Z
090426152039Z0H10UThawte Freemail Member1%0#	*H
	z.szalbot@lc-words.com00
	*H
0rep%'#Ouu);3Q{e摶y EU<>._$u}j_yӚMfO|y\=h!bTKky3	
.d?ge(zz3010!U0z.szalbot@lc-words.com0U00
	*H
wm_Uϩ^C{cdl8j*?)zLLoZ~h:b3
CjRm6?JqL/jA02&yG(	Q[$f060?0
0
	*H
010	UZA10UWestern Cape10U	Cape Town10U
Thawte Consulting1(0&UCertification Services Division1$0"UThawte Personal Freemail CA1+0)	*H
	personal-freemail@thawte.com0
030717000000Z
130716235959Z0b10	UZA1%0#U
Thawte Consulting (Pty) Ltd.1,0*U#Thawte Personal Freemail Issuing CA00
	*H
0Ħ<UsUNʙZhup[v:aQP
0cZ,p+Z?qV˯<6$*+w=+>@dקe*TH<a@dr`00U00CU<0:08642http://crl.thawte.com/ThawtePersonalFreemailCA.crl0U0)U"0 010UPrivateLabel2-1380
	*H
HP.
fgCL!6-6/P p<ab:~t%Pb'qW%ݩ9 Oe_N4[5MwV!x!5$F]_eO100v0b10	UZA1%0#U
Thawte Consulting (Pty) Ltd.1,0*U#Thawte Personal Freemail Issuing CA{KL/GY`0	+0	*H
	1	*H
0	*H
	1
080502155806Z0#	*H
	1ac5A.ʧx|0R	*H
	1E0C0
*H
0*H
0
*H
@0+0
*H
(0	+71x0v0b10	UZA1%0#U
Thawte Consulting (Pty) Ltd.1,0*U#Thawte Personal Freemail Issuing CA{KL/GY`0*H
	1xv0b10	UZA1%0#U
Thawte Consulting (Pty) Ltd.1,0*U#Thawte Personal Freemail Issuing CA{KL/GY`0
	*H
Ov1+P@fdK]!&CA}Sx]Frk^v?/¦nS0Q3|)ϝeӶɩ#xVaOI^!%%ܻ=eBHc/:pBk	۲@Ib
help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?481B3A0E.6060300>