MySQL 5.0.x FEDERATED 表创建的正确语法?
因此,我尝试使用 文档。接下来,我创建了一个像这样的表:
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:[email protected]:3306/';
每次执行此操作时,我都会收到错误:
ERROR 1432 (HY000): Can't create federated table. The data source connection string 'mysql://user:[email protected]:3306/' is not in the correct format
我查看了文档,并且我相信我正在遵循此中的文档。此连接字符串的正确语法是什么?
So I'm trying to create a federated table using the syntax from the docs. Following this, I've created a table like so:
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:[email protected]:3306/';
Every time I do this, I get the error:
ERROR 1432 (HY000): Can't create federated table. The data source connection string 'mysql://user:[email protected]:3306/' is not in the correct format
I've looked at the docs, and I believe that I'm following the docs in this. What is the proper syntax for this connection string?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
毕竟我没有遵循文档。我忽略了将远程数据库和表添加到连接字符串中。正确的连接字符串应该是:
I wasn't following the docs after all. I neglected to add the remote database and table into the connection string. The proper connection string would have been:
还要确保你的/etc/my.cnf有
然后重新启动mysql服务。默认情况下它可能未启用。
Also make sure your /etc/my.cnf has
Then restart the mysql service. It may not be enabled by default.