简体   繁体   中英

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

SHOW VARIABLES LIKE 'log_bin';

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'

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

要么

SELECT @@log_bin;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM