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]’
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中的integer 数据类型
- MySQL存储过程
- mysql中int、bigint、smallint 和 tinyint的区别与长度
- mysql load data 导出、导入 csv
- source命令执行SQL脚本文件
- MySQL创建用户及权限控制
- MySQL管理数据表
- linux下mysql添加用户
- mysql procedure
- mysql触发器
- MySQL 备份和恢复策略
- mac下安装mysql(转载)
- mysql 修改编码 Linux/Mac/Unix/通用(杜绝修改后无法启动的情况!)
- MySQL数据的导出、导入(mysql内部命令:mysqldump、mysql)
- mysql数据行转列
- Linux下修改MySQL编码的方法
- MySQL Server 日志
- MySQL 安全事宜
- MySQL 备份与恢复