Bug #29750 renaming server log files on Windows
Submitted: 12 Jul 2007 7:53 Modified: 17 Dec 2007 17:34
Reporter: Axel Schwenke Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.0.36 OS:Microsoft Windows
Assigned to: Paul Dubois CPU Architecture:Any
Triage: D4 (Minor)

[12 Jul 2007 7:53] Axel Schwenke
Description:
The manual in http://dev.mysql.com/doc/refman/5.0/en/log-file-maintenance.html states:

"On Windows, you cannot rename log files while the server has them open. You must stop the server and rename them, and then restart the server to create new logs."

While this is true in general - one cannot rename an open file in Windows - it does not apply to the slow query and general log of the MySQL server. It seems the server does not keep those files open between writes. The error log however cannot be renamed while the server is running.

How to repeat:
Configure MySQL to write a slow query and probably a general log. Then start the server and try to rename the log files.

Suggested fix:
The manual should be rephrased:

"On Windows, you cannot rename log files while the server has them open. Currently this applies to the MySQL error log only. You must stop the server and rename the file, and then restart the server to create a new log. However this will be seldom neccessary since FLUSH LOGS will rename the old error log with suffix -old. It is safe to rename the slow query and general log while the server is running."
[12 Jul 2007 8:08] Axel Schwenke
Renaming the slow query and general log was tested successfully with 5.0.36-nt and 5.0.41-nt. No idea when this behaviour was changed.
[17 Dec 2007 17:35] Paul Dubois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.

The general query/slow query logs can be renamed while the server has them open as of 5.0.17/5.1.3. I've updated the documentation accordingly.