Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

mysql

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

like image 894
Sean Nguyen Avatar asked Aug 05 '11 12:08

Sean Nguyen


People also ask

How do I know if MySQL is enabled by binary logging?

To retrieve a list of all the BinLogs present in your system, make use of the following command: mysql> SHOW BINARY LOGS; This command will display a list of all binary logs present in the system only when the binary log is enabled otherwise, it gives an error.

How do you know if binary logs are active?

You can use mysqlbinlog <filename> to see the queries in the binary logs. To turn it on, mysql> SET GLOBAL log_bin = ON; You will also want to edit your my. cnf so that log_bin = ON the next time you restart MySQL.

How do I enable binary logging in MySQL?

Enabling the binary logs MySQL binary logs can be enabled or disabled by adding or removing the log-bin configuration option. The log-bin parameter is in the configuration files named my. ini. When we install MySQL Server, the configuration file is created in C:\ProgramData\MySQL\MySQL Server 8.0 directory.

How do I disable MySQL binary log?

To disable the MySQL Binary Logging, you can use the --skip-log-bin or --disable-log-bin option at startup.


1 Answers

SHOW VARIABLES LIKE 'log_bin'; 
like image 162
wonk0 Avatar answered Oct 11 '22 16:10

wonk0