官术网_书友最值得收藏!

Federated

The FEDERATED storage engine allows you to create a single database on multiple physical servers. It opens a client connection to another server and executes queries against a table there, retrieving and sending rows as needed. It was originally marketed as a competitive feature that supported many enterprise-grade proprietary database servers, such as Microsoft SQL Server and Oracle, but that was always a stretch, to say the least. Although it seemed to enable a lot of flexibility and neat tricks, it has proven to be a source of many problems and is disabled by default. However, we can enable it by starting the MySQL Server binary with --federated option.

Let's create a FEDERATED table.

CREATE TABLE user_federated ( 
id INT(20) NOT NULL AUTO_INCREMENT,
name VARCHAR(32) NOT NULL DEFAULT '',
PRIMARY KEY (id),
INDEX name (name))
ENGINE=FEDERATED DEFAULT CHARSET=latin1
CONNECTION='mysql://remote_user:[password]@remote_host:port/federated/table';

The connection field contains information mentioned as follows for your ready reference:

  • remote_user: A username of remote MySQL Server
  • password: A password of remote MySQL Server
  • remote_host: A hostname of the remote server
  • port: Port number of the remote server
  • federated: Remote server database name
  • table: Remote server database table name
主站蜘蛛池模板: 元江| 呼玛县| 海林市| 汽车| 临夏市| 东台市| 丹巴县| 乐亭县| 开封市| 南汇区| 大荔县| 阳原县| 郧西县| 略阳县| 邯郸县| 云阳县| 南丹县| 西城区| 康乐县| 历史| 苏尼特左旗| 金堂县| 桂东县| 邻水| 隆昌县| 都匀市| 宾川县| 拉萨市| 云和县| 洪湖市| 徐州市| 土默特右旗| 穆棱市| 苍山县| 图木舒克市| 浦东新区| 金门县| 石家庄市| 嘉定区| 泾川县| 襄城县|