安装InnoDB Plugin

对于mysql5.1.38之后的版本,要使用新的InnoDB Plugin存储引擎,只需在my.cnf中做如下配置:

[mysqld]
ignore-builtin-innodb
plugin-load=innodb=ha_innodb_plugin.so
plugin-load=innodb_trx=ha_innodb_plugin.so
plugin-load=innodb_locks=ha_innodb_plugin.so
plugin-load=innodb_cmp=ha_innodb_plugin.so
plugin-load=innodb_cmp_reset=ha_innodb_plugin.so
plugin-load=innodb_cmpmem=ha_innodb_plugin.so
plugin-load=innodb_cmpmem_reset=ha_innodb_plugin.so


或是在命令行下加载

mysql>install plugin innodb soname ‘ha_innodb_plugin.so’;
mysql>install plugin innodb_trx soname ‘ha_innodb_plugin.so’;
mysql>install plugin innodb_locks soname ‘ha_innodb_plugin.so’;
mysql>install plugin innodb_cmp soname ‘ha_innodb_plugin.so’;
mysql>install plugin innodb_cmp_reset soname ‘ha_innodb_plugin.so’;
mysql>install plugin innodb_cmpmem soname ‘ha_innodb_plugin.so’;
mysql>install plugin innodb_cmpmem_reset soname ‘ha_innodb_plugin.so’;


要想完成动态加载innodb plugin是有条件的:

1. 使用源码编译的,默认innobase没有被编译进来;使用二进制包安装的,在启动前,在my.cnf里面加入skip-innodb或是ignore_builtin_innodb。

2. 使用源码编译时,不能使用–with-mysqld-ldflags=-all-static选项,以静态方式编译库,当show global variables like ‘have_%’;的时候,输出有一项是have_dynamic_loading将是NO,这就决定mysql是否支持动态加载plugin;而二进制包安装的mysql,就是动态编译的,支持动态加载plugin,这项为Yes。

SHOW ENGINES;
SHOW PLUGINS;

mysql> show engines;
+------------+---------+----------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+------------+---------+----------------------------------------------------------------+--------------+------+------------+
| CSV | YES | CSV storage engine | NO | NO | NO |
| InnoDB | YES | Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
| BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO |
| MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance | NO | NO | NO |
| 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)

mysql> show plugins;
+---------------------+--------+--------------------+---------------------+---------+
| Name | Status | Type | Library | License |
+---------------------+--------+--------------------+---------------------+---------+
| binlog | ACTIVE | STORAGE ENGINE | NULL | GPL |
| partition | ACTIVE | STORAGE ENGINE | NULL | GPL |
| BLACKHOLE | ACTIVE | STORAGE ENGINE | NULL | GPL |
| CSV | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MEMORY | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MyISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MRG_MYISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
| InnoDB | ACTIVE | STORAGE ENGINE | ha_innodb_plugin.so | GPL |
| INNODB_TRX | ACTIVE | INFORMATION SCHEMA | ha_innodb_plugin.so | GPL |
| INNODB_LOCKS | ACTIVE | INFORMATION SCHEMA | ha_innodb_plugin.so | GPL |
| INNODB_LOCK_WAITS | ACTIVE | INFORMATION SCHEMA | ha_innodb_plugin.so | GPL |
| INNODB_CMP | ACTIVE | INFORMATION SCHEMA | ha_innodb_plugin.so | GPL |
| INNODB_CMP_RESET | ACTIVE | INFORMATION SCHEMA | ha_innodb_plugin.so | GPL |
| INNODB_CMPMEM | ACTIVE | INFORMATION SCHEMA | ha_innodb_plugin.so | GPL |
| INNODB_CMPMEM_RESET | ACTIVE | INFORMATION SCHEMA | ha_innodb_plugin.so | GPL |
+---------------------+--------+--------------------+---------------------+---------+
15 rows in set (0.00 sec)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值