Jump to content

MySQL Federated

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 14.140.212.234 (talk) at 12:38, 26 September 2012. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
MySQL Federated Storage Engine
Original author(s)abhinav kumar ]
Initial release2012
Operating systemLinux, Mac OS X, Unix; Windows
Platformx86, x86-64, SPARC, MIPS, PowerPC
Available inC/C++
TypeDatabase engine
LicenseGNU General Public License
Websitehttp://mysql.bkbits.com

The MySQL Federated storage engine for the MySQL relational database management system is a storage engine which allows a user to create a table that is a local representation of a foreign (remote) table. It utilizes the MySQL client library API as a data transport, treating the remote data source the same way other storage engines treat local data sources whether they be MYD files (MyISAM), memory (Cluster, Heap), or tablespace (InnoDB). Each Federated table that is defined there is one .frm (data definition file containing information such as the URL of the data source). The actual data can exist on a local or remote MySQL instance.

To create a Federated table, one has to specify a URL in the "CONNECTION" string:

create table t1 (
 a int,
 b varchar(32))
ENGINE=FEDERATED CONNECTION='mysql://user@hostname/test/t1'

The connection URL is in the format of:

scheme://user:pass@host:port/schema/tablename

you can also create Federated table

Step 1:Create the server CREATE SERVER fed FOREIGN DATA WRAPPER mysql OPTIONS (USER 'root', HOST 'hostname', DATABASE 'test' ,PASSWORD 'test' ,PORT 3306);

Step 2:Pass the server while creating the table CREATE TABLE `log` (`id` int(11) DEFAULT NULL,`name` varchar(20) DEFAULT NULL, PRIMARY KEY (`id`)) ENGINE=FEDERATED DEFAULT CHARSET=latin1 CONNECTION='fed'

Upon creation of a Federated table, the user must ensure that the remote data source does indeed exist or an error will be issued.

The MySQL Federated Storage Engine was authored by Patrick Galbraith and Brian Aker and is currently being maintained by Patrick Galbraith and Antony Curtis. It was introduced in 2005 with MySQL 5.0.