* 3 modes(formats) : row, statement, mixed
* statement-based or row-based replication or mixed
//=== http://dev.mysql.com/doc/refman/5.1/en/binary-log-setting.html
* Globally change binlog format
The logging format also can be switched at runtime. To specify the format globally for all clients,
set the global value of the binlog_format system variable:
mysql> SET GLOBAL binlog_format = 'STATEMENT';
mysql> SET GLOBAL binlog_format = 'ROW';
mysql> SET GLOBAL binlog_format = 'MIXED';
* per-session change binlog format
An individual client can control the logging format for its own statements
by setting the session value of binlog_format:
mysql> SET SESSION binlog_format = 'STATEMENT';
mysql> SET SESSION binlog_format = 'ROW';
mysql> SET SESSION binlog_format = 'MIXED';
*** Each MySQL Server can set its own and only its own binary logging format
(no matter whether binlog_format is set with global or session scope).
--> changing the logging format on a replication master does not cause a slave to change
its logging format to match
--> Error executing row event: 'Cannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENT.'
*** If you are using InnoDB tables and the transaction isolation level is READ COMMITTED or READ UNCOMMITTED,
only row-based logging can be used.
//=== There are exceptions when you cannot switch the replication format at runtime:
* From within a stored function or a trigger
* If the NDBCLUSTER storage engine is enabled
* If the session is currently in row-based replication mode and has open temporary tables
2015年4月4日 星期六
mysql binlog modes (formats)
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言