MySQL - SHOW BINARY LOGS Statement



MySQL SHOW BINARY LOGS Statement

The SHOW BINARY LOGS statement displays the binary log files on the MySQL server. To execute this statement, you need REPLICATION CLIENT privilege. In addition to the name of the log files this statement also displays the size of the file and a Boolean value specifying whether the file is encrypted.

Example

You can display the list of binary log files in the server as shown below −

SHOW BINARY LOGS;

Output

The above mysql query produces the following output −

Log_name File_size Encrypted
TP-bin.000105 5292 NO
TP-bin.000106 195551 NO
TP-bin.000107 61891 NO
TP-bin.000108 26513 NO
TP-bin.000109 179 NO
TP-bin.000110 8112 NO
TP-bin.000111 1566 NO
TP-bin.000112 10769 NO
TP-bin.000113 156 NO

You can also use the MASTER instead of BINARY to retrieve the info list of the log files in the server.

SHOW MASTER LOGS;

Output

Following is the output of the above query −

Log_name File_size Encrypted
TP-bin.000105 5292 NO
TP-bin.000106 195551 NO
TP-bin.000107 61891 NO
TP-bin.000108 26513 NO
TP-bin.000109 179 NO
TP-bin.000110 8112 NO
TP-bin.000111 1566 NO
TP-bin.000112 10769 NO
TP-bin.000113 156 NO
Advertisements