Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is is possible to create a FEDERATED on VIEW for mysql

How can I create a FEDERATED on VIEW which placed on remote server? I'm using MySQL.

like image 633
Tioma Avatar asked Mar 23 '11 10:03

Tioma


People also ask

How to add FEDERATED engine in MySQL?

To include the FEDERATED storage engine if you build MySQL from source, invoke CMake with the -DWITH_FEDERATED_STORAGE_ENGINE option. The FEDERATED storage engine is not enabled by default in the running server; to enable FEDERATED , you must start the MySQL server binary using the --federated option.

What is FEDERATED database MySQL?

A FEDERATED table consists of two elements: A remote server with a database table, which in turn consists of the table definition (stored in the MySQL data dictionary) and the associated table. The table type of the remote table may be any type supported by the remote mysqld server, including MyISAM or InnoDB .

What is a FEDERATED table?

A Federated Table is a PostgreSQL Foreign Data Wrapper to a remote server, allowing us to perform live queries to a remote database. Think of it as a virtual table that looks like a regular sync table in CARTO — but when used, makes the queries you perform in CARTO travel to the remote database and get executed there.


1 Answers

Yes, you can create a FEDERATED table on a VIEW.

Here's a simple example:

create table t_table (
id int not null auto_increment primary key
) engine = innodb;

create or replace view v_view as select * from t_table;

create table f_fed_table (
id int not null
) ENGINE=FEDERATED CONNECTION='mysql://user:[email protected]:3306/test/v_view';
like image 164
Ike Walker Avatar answered Sep 20 '22 20:09

Ike Walker