NYCPHP Meetup

NYPHP.org

[nycphp-talk] MySQL slow query log/general mysql log

Matt Juszczak matt at atopia.net
Tue Sep 7 15:04:10 EDT 2010


This behavior is OS specific (or configuration specific I should say). 
While MySQL has the bin log days setting to automatically rotate binary 
logs, it does not automatically rotate the slow query log or general log 
unless configured by an external utility (like mentioned below - 
logrotate), unless I am mistaken?

On Tue, 7 Sep 2010, Donald J. Organ IV wrote:

> Just edit the logrotate config for the mysql logs and change the create line.
> 
> 
> 
> _________________________________________________________________________________________________________________________
> From: "Anthony Wlodarski" <anthony at dating2p0.com>
> To: "NYPHP Talk" <talk at lists.nyphp.org>
> Sent: Tuesday, September 7, 2010 2:43:51 PM
> Subject: Re: [nycphp-talk] MySQL slow query log/general mysql log
> 
> MySQL does rotate the slow query log at least on my systems it is automated.  I did a quick look at the MySQL man pages
> just to verify if it does behave this way but could not confirm.  This could present a problem when MySQL goes to rotate
> it off.  If it uses an internal "cp -p" then permissions and the such will just be copied to the backup logs.  However I
> don't know if the original file is truncated or recreated.  If it is recreated then MySQL will only recreate it with the
> default 640 permissions.  If it is just truncated then you are in the clear but I am willing to be on the aforementioned.
> 
>


More information about the talk mailing list