A MySQL replication slave is set up as follows:
. Uses all InnoDB tables
. Receives ROW-based binary logs
. Has the read-only option
The replication slave has been found in an error state.
You check the MySQL error log file and find these entries:
2013-08-27 13:55:44 9056 [EROR] Slave SQL: Cloud not execute Write rows event on table test.t1; Duplicate entry ‘3’ for key ‘PRIMARY’, Error_code: 1062; handler error
HA_ERR_FOUND_DUPP_KEY; the event’s master log 56_master-bin.000003, end_log_pos 653,
Error_code: 1062
2013-08-27 13:55:44 9056 [Warning] Slave: Duplicate entry ‘3’ for key ‘PRIMARY’ Error code:
1062
2013-08-27 13:55:44 9056 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with ‘SLAVE START’. We stopped at log ‘56_master-bin.000003’ position 496
What are two possible causes for this error to occur?
A. The applications have the SUPER privilege, which allows them to update rows.
B. The root user on the slave has executed FLUSH LOGS, causing the relay-log to doublewrite.
C. For tables with UNIQUE keys, statement-based replication must be used to maintain integrity.
D. The slave was created with mysqldump –u root -p —skip-lock-tables -all-databases >/data/data.sql
E. The slave user does not have INSERT, UPDATE, or DELETE permission and cannot execute the Write_rows function.
Answer: AD
某从库的配置如下:
全部是InnoDB表
接收ROW格式的binlog
配置有read-only
报错信息如下:
下面哪两种可能的情况会造成此问题?
A.应用程序具有SUPER权限
B.从库上执行了FLUSH LOGS命令
C.对于包含UNIQUE约束的表,必须使用基于statement格式binlog的复制才能保证一致性
D.从库是使用如下mysqldump命令创建的:mysqldump –u root -p —skip-lock-tables -all-databases >/data/data.sql
E.复制用户没有足够的权限执行INSERT、UPDATE或者DELETE语句
版权声明:本文为博主原创文章,未经博主允许不得转载。
MYSQL
发表评论