您的位置:首页 > Web前端

FEDERATED存储引擎的使用,如何开启FEDERATED,FEDERATED Support NO?

2016-01-21 10:47 399 查看
开启FEDERATED存储的方法如下:

1.查看是否安装了federated引擎

[plain] view plain copy print?在CODE上查看代码片派生到我的代码片

mysql> show engines;

+————+———+————————————————————+————–+——+————+

| Engine | Support | Comment | Transactions | XA | Savepoints |

+————+———+————————————————————+————–+——+————+

| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |

| CSV | YES | CSV storage engine | NO | NO | NO |

| MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance | NO | NO | NO |

| InnoDB | YES | Supports transactions, row-level locking, and foreign keys | YES | YES | YES |

| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |

+————+———+————————————————————+————–+——+————+

5 rows in set (0.00 sec)

从中可以看出federated引擎没有开启.

2.开启federated引擎

vi /etc/my.cnf

在[mysqld]之后添加:

federated

3.安装federated存储引擎

[plain] view plain copy print?在CODE上查看代码片派生到我的代码片

mysql> install plugin federated soname ‘ha_federated.so’;

Query OK, 0 rows affected, 1 warning (0.07 sec)

4.查看是否安装了federated引擎

[plain] view plain copy print?在CODE上查看代码片派生到我的代码片

mysql> show engines;

+————+———+————————————————————+————–+——+————+

| Engine | Support | Comment | Transactions | XA | Savepoints |

+————+———+————————————————————+————–+——+————+

| FEDERATED | YES | Federated MySQL storage engine | NO | NO | NO |

| CSV | YES | CSV storage engine | NO | NO | NO |

| MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance | NO | NO | NO |

| InnoDB | YES | Supports transactions, row-level locking, and foreign keys | YES | YES | YES |

| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |

| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |

+————+———+————————————————————+————–+——+————+

6 rows in set (0.00 sec)

5.创建表语句:

使用FEDERATED建表语句如下:

CREATE TABLE (……) ENGINE =FEDERATED CONNECTION=’mysql://[name]:[pass]@[location]:[port]/[db-name]/[table-name]’
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  mysql