Disabling binary logs for a session

There may be cases where you do not want the statements to be replicated to other servers. For that, you can use the following command to disable binary logging for that session: 

mysql> SET SQL_LOG_BIN = 0;

All the SQL statements logged after executing the previous statement are not logged to the binary log. This applies only for that session.

To enable, you can execute the following:

mysql> SET SQL_LOG_BIN = 1;

Get MySQL 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.