Rechercher dans le manuel MySQL
16.8.2.1 Creating a FEDERATED Table Using CONNECTION
To use the first method, you must specify the
CONNECTION
string after the engine type in a
CREATE TABLE
statement. For
example:
- )
- ENGINE=FEDERATED
CONNECTION
replaces the
COMMENT
used in some previous versions of
MySQL.
The CONNECTION
string contains the
information required to connect to the remote server containing
the table that will be used to physically store the data. The
connection string specifies the server name, login credentials,
port number and database/table information. In the example, the
remote table is on the server remote_host
,
using port 9306. The name and port number should match the host
name (or IP address) and port number of the remote MySQL server
instance you want to use as your remote table.
The format of the connection string is as follows:
scheme://user_name[:password]@host_name[:port_num]/db_name/tbl_name
Where:
scheme
: A recognized connection protocol. Onlymysql
is supported as thescheme
value at this point.user_name
: The user name for the connection. This user must have been created on the remote server, and must have suitable privileges to perform the required actions (SELECT
,INSERT
,UPDATE
, and so forth) on the remote table.password
: (Optional) The corresponding password foruser_name
.host_name
: The host name or IP address of the remote server.port_num
: (Optional) The port number for the remote server. The default is 3306.db_name
: The name of the database holding the remote table.tbl_name
: The name of the remote table. The name of the local and the remote table do not have to match.
Sample connection strings:
Document created the 26/06/2006, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/mysql-rf-federated-create-connection.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.