Correct syntax for creating MySQL 5.0.x FEDERATED?

So, I am trying to create a federated table using the syntax of documents . After that, I created the table as follows:

CREATE TABLE `federated_table` (
  `table_uid` int(10) unsigned not null auto_increment,
  ...,
  PRIMARY KEY (`table_uid`)
) ENGINE=FEDERATED DEFAULT CHARSET=latin1 CONNECTION='mysql://user:password@host.name:3306/';

Every time I do this, I get an error:

ERROR 1432 (HY000): Can't create federated table. The data source connection string 'mysql://user:password@host.name:3306/' is not in the correct format

I looked through the documents and I believe that I am following the documents. What is the correct syntax for this connection string?

+3
source share
2 answers

In the end, I did not follow the documents. I neglected to add the remote database and table to the connection string. The correct connection string would be:

mysql://user:password@host.name:3306/remote_db/table
+5
source

Also make sure your /etc/my.cnf has

[mysqld]
federated

mysql. .

+2

Source: https://habr.com/ru/post/1722468/


All Articles