Bug #51629 No good way to find the location of the binary log.
Submitted: 2 Mar 2010 9:27 Modified: 2 Mar 2010 12:05
Reporter: Tobias Asplund Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: Logging Severity:S3 (Non-critical)
Version:5.1.44 OS:Any
Assigned to: CPU Architecture:Any
Triage: Triaged: D5 (Feature request)

[2 Mar 2010 9:27] Tobias Asplund
the log_error variable will show the location of the error log.
general_log_file shows the location of the general query log.
slow_query_log_file shows the location of the slow query log.

But there is no way to find out where the binary log is kept.

How to repeat:
mysql> SHOW VARIABLES LIKE 'log_error';
| Variable_name | Value                       |
| log_error     | /var/log/mysql/51-error.log | 
1 row in set (0.56 sec)

mysql> SHOW VARIABLES LIKE 'log_bin';
| Variable_name | Value |
| log_bin       | ON    | 
1 row in set (0.00 sec)

Suggested fix:
It would be nice if log_bin would behave like log_error in this regard and actually show the directory or basename of the file.

(SHOW BINARY LOGS will not give the location, just the file names, adding the absolute path to this command would be sufficient as a fix instead of the above suggestion - probably even prefferred in some cases if you changed your location of binary logs, but kept where the binary log index file is).
[2 Mar 2010 12:05] Valeriy Kravchuk
I'd say this is actually a bug, as one can set log_bin to point to the location outside of the data directory (like c:/tmp/binlog, for example, check http://dev.mysql.com/doc/refman/5.1/en/binary-log.html) and then there is NO WAY to find out (using SQL) where binary logs are really located.