Date: Fri, 2 May 2008 07:51:23 -0700 From: Chris Pratt <eagletree@hughes.net> To: z.szalbot@lc-words.com Cc: freebsd-questions@freebsd.org Subject: Re: handling mysql binlog data Message-ID: <4C629ECE-9203-4A3B-94FA-8BACEA07EE70@hughes.net> In-Reply-To: <481B08B2.7070702@lc-words.com> References: <481B08B2.7070702@lc-words.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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 Simply doing an rm on the files you know are no longer in use is probably not a good idea because they are known within mysql data files. Using the above will make sure they are removed in an orderly manner. According to the docs, if you use the process as shown, the active file will be skipped even if you accidently try to remove it. > Many thanks for sharing! > -- > Zbigniew Szalbot > www.lc-words.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C629ECE-9203-4A3B-94FA-8BACEA07EE70>