码迷,mamicode.com
首页 > 其他好文 > 详细

Binary Logging Formats

时间:2017-08-24 14:04:28      阅读:252      评论:0      收藏:0      [点我收藏+]

标签:mat   www.   -o   his   ever   prim   doc   --   for   

Binary Logging Formats

  The server uses several logging formats to record information in the binary log. The exact format employed depends on the version of MySQL being used. There are three logging formats:

  • Replication capabilities in MySQL originally were based on propagation of SQL statements from master to slave. This is called statement-based logging. You can cause this format to be used by starting the server with --binlog-format=STATEMENT.

  • In row-based logging, the master writes events to the binary log that indicate how individual table rows are affected. It is important therefore that tables always use a primary key to ensure rows can be efficiently identified. You can cause the server to use row-based logging by starting it with --binlog-format=ROW.

  • A third option is also available: mixed logging. With mixed logging, statement-based logging is used by default, but the logging mode switches automatically to row-based in certain cases as described below. You can cause MySQL to use mixed logging explicitly by starting mysqld with the option --binlog-format=MIXED.

The logging format can also be set or limited by the storage engine being used. This helps to eliminate issues when replicating certain statements between a master and slave which are using different storage engines.

参考:

1、http://www.cnblogs.com/sunziying/p/6587945.html

2、https://dev.mysql.com/doc/refman/5.7/en/binary-log-formats.html

Binary Logging Formats

标签:mat   www.   -o   his   ever   prim   doc   --   for   

原文地址:http://www.cnblogs.com/tekkaman/p/7422619.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!