Sean Nguyen
Sean Nguyen

Reputation: 13118

how to know if mysql binary log is enable through sql command?

I have a mysql instance running and I want to know if binary log is enable for that instance without logging into the machine and check my.cnf file. Is there a way to do that?

Thanks, Sean

Upvotes: 43

Views: 35284

Answers (3)

kta
kta

Reputation: 20110

After login Execute the following command

SHOW BINARY LOGS

If there is no binary logs then you will get a message similar to 'You are not using binary logging'

Upvotes: 16

Devart
Devart

Reputation: 121902

SELECT * from information_schema.GLOBAL_VARIABLES WHERE VARIABLE_NAME = 'LOG_BIN';

or

SELECT @@log_bin;

Upvotes: 6

wonk0
wonk0

Reputation: 13952

SHOW VARIABLES LIKE 'log_bin';

Upvotes: 78

Related Questions