Friday, May 9, 2008

MySQL replication filtering

This from a question on #mysql, how can you filter whats replicated between master and slave.
Now i was aware of the Database and Table level filtering such as using
--replicate-do-db=db_name
--replicate-do-table=table_name
--replicate-ignore-db=db_name
--replicate-ignore-table=table_name

etc

What i didn't know about was this:
http://dev.mysql.com/doc/refman/5.0/en/set-sql-log-bin.html
SET SQL_LOG_BIN = {0|1}

Disables or enables binary logging for the current connection (SQL_LOG_BIN is a session variable) if the client has the SUPER privilege. The statement is refused with an error if the client does not have that privilege.

Thats kind of kewl.

No comments: