Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Just as the topic states.

Is it possible to issue an INSERT / UPDATE / DELETE and specify for it not to be relayed to attached slaves in mysql?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Here is a quick and dirty answer:

Simply run SET SQL_LOG_BIN=0; before each SQL command. It prevents subsequent SQL from entering the Master's binary log upon the completion of any SQL statement afterwards. Thus, it cannot be shipped forward to any Slave. However, there will be no record of the SQL being executed in the Binary Logs.

Within the given DB Connection, if you want to start recording again, just run SET SQL_LOG_BIN=1; before each SQL command.

Opening a new connection will having binary logging enabled within it by default.

share|improve this answer
    
Just making sure... This is a 'session' setting not a global one? Thanks! –  anonymous-one Feb 6 '12 at 20:23
    
It's per session, not global. –  atxdba Feb 6 '12 at 21:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.