MYSQL创建FEDERATED表报错SQL 错误 [1286] [42000]: Unknown storage engine 'FEDERATED'
时间: 2024-01-06 15:06:06 浏览: 39
这个错误通常表示你的MySQL服务器没有安装或启用FEDERATED存储引擎。要解决这个问题,你需要在MySQL服务器上启用FEDERATED存储引擎。以下是一些步骤:
1. 打开MySQL配置文件my.cnf(或my.ini),通常位于/etc/mysql/或/usr/local/mysql/etc/目录下。
2. 在[mysqld]部分添加以下行:
skip-federated
3. 保存并关闭配置文件。
4. 重启MySQL服务器。
5. 现在你应该可以创建FEDERATED表了。
相关问题
Federated Storage Engine
Federated Storage Engine是MySQL数据库中的一种存储引擎,它允许MySQL服务器访问远程的MySQL数据库或其他数据库(例如Oracle、SQL Server等),并将远程数据库中的数据视为本地数据。使用Federated Storage Engine,可以在MySQL数据库中实现跨数据库的查询和数据传输,从而方便地实现数据共享和集成。
Federated Storage Engine的工作原理是,当查询请求到达MySQL服务器时,MySQL服务器将查询请求转发给Federated Storage Engine,然后由Federated Storage Engine将查询请求发送给远程数据库,最后将查询结果返回给MySQL服务器。Federated Storage Engine在本地缓存远程数据库的元数据和查询计划,以提高查询性能。
使用Federated Storage Engine时需要注意以下几点:
1. 远程数据库必须支持对应的协议,例如MySQL协议、ODBC协议等。
2. Federated Storage Engine仅支持查询操作,不支持更新和删除操作。
3. Federated Storage Engine不支持所有的SQL语法,例如存储过程、触发器等。
4. Federated Storage Engine在执行跨数据库查询时,可能会影响性能,因此需要根据实际情况进行优化。
总之,Federated Storage Engine是MySQL数据库中的一种强大的跨库查询工具,可以方便地实现数据共享和集成,但需要注意其使用限制和性能问题。
mysql 开启 federated
To enable the FEDERATED storage engine in MySQL, you need to make sure that it is installed and enabled in your MySQL server. The FEDERATED storage engine is included in most MySQL distributions, but it may not be enabled by default.
To check if FEDERATED is installed and enabled, you can run the following command in your MySQL server:
```
SHOW ENGINES;
```
This will display a list of all the storage engines that are installed and enabled in your MySQL server. Look for the FEDERATED engine in the list. If it is not listed, you may need to install it or enable it in your MySQL configuration.
To enable the FEDERATED engine in MySQL, you can add the following line to your MySQL configuration file (usually my.cnf or my.ini):
```
federated
```
Then, restart your MySQL server for the changes to take effect.
Once FEDERATED is enabled, you can create FEDERATED tables in your MySQL server using the syntax I mentioned in my previous answer.