How can I create a FEDERATED on VIEW which placed on remote server? I'm using 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.
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 .
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.
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';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With