Check to make sure the binary log index is not out-of-sync.

Here is how you can do this:

Run 'SHOW BINARY LOGS;'
Look to see if any of the entries reports a zero length in it or includes a 
binary log that does not exist.

Every time you shutdown mysqld, mysqld writes what it has in its memory rather 
than investigating the folder for the actual binary log names.

You may have to shutdown mysqld, edit the binary log index file in vi (or 
emacs, nano, etc.), making sure the entries match with what is in the linux 
folder (datadir), then start mysqld.

If this file is not in-sync, PURGE commands will not work. When 
expire_logs_days is set in my.cnf, if the binary log index files is out of 
sync, automatic binary log deletion does not work either.

BTW When expire_logs_days is set in my.cnf, mysqld will delete binary logs on 
startup or when the system clock crosses midnight.

Rolando A. Edwards
MySQL DBA (CMDBA)

155 Avenue of the Americas, Fifth Floor
New York, NY 10013
212-625-5307 (Work)
201-660-3221 (Cell)
AIM : RolandoLogicWorx
Skype : RolandoLogicWorx
redwa...@logicworks.net

-----Original Message-----
From: Jerome Macaranas [mailto:jerom...@gmail.com] 
Sent: Tuesday, May 12, 2009 2:53 PM
To: edb...@edberg-online.com
Cc: Rilawich Ango; mysql@lists.mysql.com
Subject: Re: mysql-bin maintenance

i tried this one

PURGE { BINARY | MASTER } LOGS
    { TO '*log_name*' | BEFORE *datetime_expr* }


but for some reason it didn't purge any bin file.. so i tried our expired...
on the my.cnf waited for a while and it was deleted...

is there a requirement to use "purge" i have "5.0.51a-0.rhel4" running on my
test box.




On Mon, May 11, 2009 at 10:15 PM, <edb...@edberg-online.com> wrote:

> On Mon, May 11, 2009 6:41 pm, Rilawich Ango wrote:
> > Hi,
> > In the master database, there are plenty of mysql-bin.X.  It
> > occupied almost all the disk space.  As I know, the files should be
> removed
> > by issuing reset master.  Below are my questions. -Do I need to stop
> > replication before issuing reset master?  If yes, do I need to rebuild
> the
> > replication after reset master?  If no, does the existing replication
> > broken after reset master? ango
> >
>
> See
>
>   http://dev.mysql.com/doc/refman/5.0/en/purge-binary-logs.html
>
> (or the relevant URL for your language/version). And you can use the
> expire_logs_days system variable to have MySQL automatically purge old
> logs.
>
>   - steve
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql?unsub=jerom...@gmail.com
>
>

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=arch...@jab.org

Reply via email to