Bug #19614 log_bin variables show something else than entered in my.cnf
Submitted: 8 May 2006 14:56 Modified: 19 Aug 2010 22:28
Reporter: Oli Sennhauser Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: General Severity:S4 (Feature request)
Version:5.0, 5.1 OS:Any
Assigned to: Assigned Account CPU Architecture:Any
Tags: Contribution

[8 May 2006 14:56] Oli Sennhauser
log-bin in my.cnf is entered like this:

log-bin               = /backup/binary_log

But shown in show variables like this:

show variables like 'log%';
| Variable_name                   | Value |
| log_bin                         | ON    |

Completly inconsistent.

How to repeat:

Suggested fix:
Split binary logging into 2 different variables:
1.) log_bin_path [DEFAULT | ...]
2.) log_bin [ON|OFF]

See also Bug 19612
[23 Aug 2008 2:50] Gary Pendergast

shell> mysqld --help --verbose | grep "^log-bin "
[28 Aug 2008 0:54] Gary Pendergast
Patch against current 5.1 bazaar tree

Attachment: bug19614.patch (text/x-diff), 2.19 KiB.

[28 Aug 2008 0:55] Gary Pendergast
Patch attached to this bug adds the 'log_bin_name' global variable, shows the same output as the workaround.
[5 Mar 2009 8:57] Lars Thalmann
Please make explicit in this bug report:

1. Whether this is a bug. The system variable gives info about whether 
   logging is on or not, not about the file name.  Isn't that 
   what one can expect?

2. What would be the benefit of splitting the variable into two?
   Why would anyone want it?

Setting bug to open until this is added.
[5 Nov 2009 0:20] Justin Swanhart
I need to consume binlogs with an external process.  I need to know where the log files are stored in order to read them, assuming I have proper filesystem permissions to do so.

Either 'SHOW BINARY LOGS' should include the path name
SHOW GLOBAL STATUS LIKE 'log_bin' should show the path name
There should be a new global status variable called 'log_bin_path'
[4 Mar 2010 0:21] Robin Bowes
I've just hit the same bug.

I want to clean up/purge binlog files by compare "show master logs" with a glob of the binlog dir. I'd like to be able to get binlog dir and the binlog file root name programmatically.

This works for the relay logs:

| Variable_name         | Value                           |
| max_relay_log_size    | 0                               | 
| relay_log             | relay_bin/mysql-relay-bin       | 
| relay_log_index       | relay_bin/mysql-relay-bin.index | 
| relay_log_info_file   | relay-log.info                  | 
| relay_log_purge       | ON                              | 
| relay_log_space_limit | 0                               | 

So, I know that the relay log files are:


But, I can't do the same thing for the binlog files.
[1 Sep 2010 20:28] Dan Gosner
I have the same problem.  Someone asked why this is needed.  It is needed because I want my application to monitor free space in the area and alert when space may be a problem.  Other file locations are available via the database engine.  This one is not.
[25 Sep 2010 1:59] Ricardo M
I would like get the location from these logs using a system variable so that from a shell script I can copy them. Sound like still is not working :-(
[25 Sep 2010 2:00] Ricardo M
I would like get the location from these logs using a system variable so that from a shell script I can copy them. Sound like still is not working in 5.1 :-(
[27 Sep 2010 9:24] Mats Kindahl
This is being implemented in WL#5465 right now, so look there for more information.
[21 Oct 2010 1:09] Mark Callaghan
That worklog doesn't specify variables that list the directory in which the files are stored. Those values will be useful for scripting and I prefer not to have all scripts extract the dirname from '/path/to/binlogs/bl-'
[21 Oct 2010 1:45] Mark Callaghan
patch to add binlog_file_basedir and binlog_index_basedir global variables

Attachment: 0001-Add-global-variables-to-list-directory-for-binlog-fi.patch (, text), 5.67 KiB.