
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中的表数据,创建完成之后,你会神奇的发现你当前创建的这个表中已经有远程表里面的所有数据了。