Bug #60878 mysqladmin doesn't support flushing specific logs
Submitted: 15 Apr 2011 9:31 Modified: 11 Jun 2014 20:49
Reporter: Daniël van Eeden Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Command-line Clients Severity:S4 (Feature request)
Version:5.5.11 OS:Any
Assigned to: CPU Architecture:Any
Tags: Contribution
Triage: Needs Triage: D5 (Feature request)

[15 Apr 2011 9:31] Daniël van Eeden
mysqladmin has a flush-logs option.

Since 5.5.3 a log type is supported by the SQL interface:

mysqladmin sends REFRESH_LOG using mysql_refresh()

There are more specific options available than REFRESH_LOG according to sql/sql_reload.cc:111

    options|= REFRESH_BINARY_LOG;
    options|= REFRESH_RELAY_LOG;
    options|= REFRESH_SLOW_LOG;
    options|= REFRESH_GENERAL_LOG;
    options|= REFRESH_ENGINE_LOG;
    options|= REFRESH_ERROR_LOG;

But these aren't used by mysqladmin

How to repeat:
Read docs.

Suggested fix:
Add logtype option to flush-logs option of mysqladmin.

I will add another bug for REFRESH_*_LOG not being documented.
[15 Apr 2011 9:36] Daniël van Eeden
Related: Bug #60879 (C API: mysql_refresh() options REFRESH_*_LOGS not documented)
[15 Apr 2011 10:19] Valeriy Kravchuk
Thank you for the feature request.
[15 Apr 2011 17:57] Daniël van Eeden
Simple fix for this feature request:

I made this fix and I've signed the SCA...
[22 May 2014 8:12] Erlend Dahl
Bug#52008 was marked as a duplicate.
[23 May 2014 6:47] Daniël van Eeden
Added the patch to make sure it won't get lost.

Attachment: de643792-69fc-11e0-8049-001e0bc3957e.txt (text/plain), 1.59 KiB.

[11 Jun 2014 20:49] Paul Dubois
Noted in 5.7.5 changelog.

The mysqladmin flush-logs command now permits optional log types to
be given, to specify which logs to flush. Following the flush-logs
command, you can provide a space-separated list of one or more of the
following log types: binary, engine, error, general, relay, slow.
These correspond to the log types that can be specified for the FLUSH
LOGS SQL statement.
[11 Jun 2014 20:51] Paul Dubois
Thanks to  Daniël van Eeden for the patch.