CREATE TABLE table_test (
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
name varchar(255) not null,
PRIMARY KEY (`id`)
) ENGINE=FEDERATED DEFAULT CHARSET=utf8 CONNECTION='mysql://root:abc@192.168.88.16:3306/dbname/tablename'
建立远程表需要.开启federated引擎;
登录mysql终端执行:show engines;确认federated 是否开启(是否是YES)
如果没有开启在,在my.ini中[mysqld]标签下下直接加上一行 federated重启数据库服务即可