connect master,127.0.0.1,root,,test,$MASTER_MYPORT,; connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,; connection master; CREATE DATABASE federated; connection slave; CREATE DATABASE federated; connection slave; create table federated.t1 (a int primary key, b varchar(64)) engine=myisam; connection master; create table federated.t1 (a int primary key, b varchar(64)) engine=federated connection='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1'; insert into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe"); ERROR 23000: Can't write; duplicate key in table 't1' select * from federated.t1; a b 1 Larry 2 Curly connection slave; truncate federated.t1; alter table federated.t1 engine=innodb; connection master; insert into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe"); ERROR 23000: Can't write; duplicate key in table 't1' select * from federated.t1; a b drop table federated.t1; connection slave; drop table federated.t1; connection master; DROP TABLE IF EXISTS federated.t1; DROP DATABASE IF EXISTS federated; connection slave; DROP TABLE IF EXISTS federated.t1; DROP DATABASE IF EXISTS federated;