
mysql> show engines;
從上面可以看到federated的support是no,說明沒有啟用,如果沒有的話說明沒有編譯進去,需要重新安裝,要像啟用的話使support為yes,可以在/etc/my.cnf加federated(在mysqld加),然後重新開機就可以啟用
配置很簡單

create table `game_broker`(
`id` int(11) not null auto_increment,
`brokerid` varchar(10) not null comment '券商id',
`broker_name` varchar(20) not null comment '名稱',
`father_id` int(11) not null comment '父id',
`path` varchar(20) not null comment 'id路徑',
`remark` varchar(100) comment '備注',
primary key (`id`)
)
engine=federated charset=utf8 connection='mysql://dasai_fed:[email protected]:3306/mysql/game_broker';
2、在遠端表上做操作

create table `game_broker` (
) eengine=innodb default charset=utf8;
3、在遠端表所在的mysql資料庫上添加一個賬号

grant select on mysql.game_broker to dasai_fed@'172.31.1.106' identified by 'daisai_fed';
4.操作2中的表資料,建立完成之後,你會神奇的發現你目前建立的這個表中已經有遠端表裡面的所有資料了。