0

我对mysql复制有一点疑问。如果主服务器上的插入失败并出现重复警报错误,则将其捕获到二进制日志中,或者将其忽略并且不会在从服务器上复制。

如果它被捕获,是否有一种机制可以在主端阻止它?

4

1 回答 1

0

我在测试机器上测试了这个。由于键或约束错误导致的主失败事务未记录到二进制日志中。

Here is how i tested

    Created a test innodb table (id primary key, name)
    Inserted a row and checked the bin log size
    Inserted another row with same id value and it failed with duplicate alert.
    Now checked the log size and there is no change in size.

谢谢

甚至使用 mysqlbinlog 实用程序验证了 binlog.... :)

于 2013-09-29T13:02:33.027 回答