mysql-bin maintenance

mysql-bin maintenance

am 12.05.2009 03:41:34 von Rilawich Ango

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

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Re: mysql-bin maintenance

am 12.05.2009 04:15:50 von edberg

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.htm l

(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=gcdmg-mysql-2@m.gmane.org

Re: mysql-bin maintenance

am 12.05.2009 20:53:09 von Jerome Macaranas

--001e680f1c102762f80469bb9bbc
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

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, 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.htm l
>
> (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=jerome.m@gmail.com
>
>

--001e680f1c102762f80469bb9bbc--

RE: mysql-bin maintenance

am 13.05.2009 00:10:50 von Rolando Edwards

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 rat=
her 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 e=
macs, 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, autom=
atic 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
redwards@logicworks.net

-----Original Message-----
From: Jerome Macaranas [mailto:jerome.m@gmail.com]=20
Sent: Tuesday, May 12, 2009 2:53 PM
To: edberg@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 m=
y
test box.




On Mon, May 11, 2009 at 10:15 PM, 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.htm l
>
> (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=3Djerome.m@gmail.co=
m
>
>

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg