On 8/7/07, Boyd Hemphill <[EMAIL PROTECTED]> wrote:
> I would like to empty the slow query log without restarting MySQL.
>
> If I simply delete lines, the server will no longer write to the file.  I 
> have tried leaving the header, but still no writes unless I restart MySQL.
>
> I am on RHEL4.
> The group and owner of the file are correct:
>      4 -rw-rw----   1 mysql mysql       157 Aug  7 06:32 slow_query_log
>
>
> Thanks in advance.

Just rename slow_query_log, then "mysqladmin flush-logs"...

http://dev.mysql.com/doc/refman/5.0/en/log-file-maintenance.html

<Quote>
The server creates a new binary log file when you flush the logs.
However, it just closes and reopens the general and slow query log
files. To cause new files to be created on Unix, rename the current
logs before flushing them. At flush time, the server will open new
logs with the original names. For example, if the general and slow
query logs are named mysql.log and mysql-slow.log, you can use a
series of commands like this:

shell> cd mysql-data-directory
shell> mv mysql.log mysql.old
shell> mv mysql-slow.log mysql-slow.old
shell> mysqladmin flush-logs

At this point, you can make a backup of mysql.old and mysql-slow.log
and then remove them from disk.
</Quote>

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to