views:

240

answers:

1

I want to connect and execute one (or sometimes several) SQL statements, and NOT have those replicated to the slaves.

I have no replicate-do or replicate-ignore configs, so I can't use some non-replicated database to send the commands from. And I know about:

set global sql_slave_skip_counter = 1

But that's on the slave. I'd like to be able to run a similar command on the master and have the following N commands not sent out to the slaves (which I guess means not logged in the binlogs, either).

+2  A: 

SET sql_log_bin=0 is what you're looking for. Requires SUPER priv., and will turn off logging of commands from your session until you set it back to 1. See http://dev.mysql.com/doc/refman/5.0/en/server-session-variables.html#sysvar_sql_log_bin

SET sql_log_bin=0;
UPDATE ... ;
INSERT ... ;
DELETE ... ;
SET sql_log_bin=1 ;
derobert