mysql插件

检查mysql是否支持动态添加插件:

select @@have_dynamic_loading ;

在master上安装插件:rpl_semi_sync_master
二进制安装的mysql插件一般放在:$MYSQL_HOME/lib/plugin
INSTALL PLUGIN rpl_semi_sync_master SONAME ‘semisync_master.so’;
show global variables like ‘rpl_semi%’;
INSTALL PLUGIN rpl_semi_sync_slave SONAME ‘semisync_slave.so’;
show global variables like ‘rpl_semi%’;
show global status like ‘rpl_semi%’;

  1. 用mysql> show plugins; 命令查看MySQL已经安装的插件

±-------------±---------±-------------------±--------------------±--------+
| Name | Status | Type | Library | License |
±-------------±---------±-------------------±--------------------±--------+
| binlog | ACTIVE | STORAGE ENGINE | NULL | GPL |
| partition | ACTIVE | STORAGE ENGINE | NULL | GPL |
| ARCHIVE | ACTIVE | STORAGE ENGINE | NULL | GPL |
| BLACKHOLE | ACTIVE | STORAGE ENGINE | NULL | GPL |
| CSV | ACTIVE | STORAGE ENGINE | NULL | GPL |
| FEDERATED | DISABLED | STORAGE ENGINE | NULL | GPL |
| MEMORY | ACTIVE | STORAGE ENGINE | NULL | GPL |
| InnoDB | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MyISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MRG_MYISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
| INNODB_TRX | ACTIVE | INFORMATION SCHEMA | ha_innodb_plugin.so | GPL |
| INNODB_LOCKS | ACTIVE | INFORMATION SCHEMA | ha_innodb_plugin.so | GPL |
±-------------±---------±-------------------±--------------------±--------+
12 rows in set (0.00 sec)

安装方法1. 在configure的时候加上–with-plugins=innobase 如果要添多个插件,请用半角逗号隔开配置文件, 将my.cnf配置文件中[mysqld]下面有关innodb配置前面的#去掉就可以了。这是默认配置,可以根据个人需要进行修改

2.先查看是否支持动态加载, 重要的是have_dynamic_loading这行,如果是YES,那么继续
mysql>show variables like “have_%”;

安装插件

mysql> INSTALL PLUGIN INNODB SONAME ‘ha_innodb.so’;
mysql> install plugin INNODB soname “ha_innodb.so”;
mysql> install plugin INNODB_TRX soname “ha_innodb.so”;
mysql> install plugin INNODB_LOCKS soname “ha_innodb.so”;
mysql> install plugin INNODB_LOCK_WAITS soname “ha_innodb.so”;
mysql> install plugin INNODB_CMP soname “ha_innodb.so”;
mysql> install plugin INNODB_CMP_RESET soname “ha_innodb.so”;
mysql> install plugin INNODB_CMPMEM soname “ha_innodb.so”;
mysql> install plugin INNODB_CMPMEM_RESET soname “ha_innodb.so”

我的debian系统上ha_innodb.so文件在/usr/lib/mysql/plugin目录下

p466106@devhz503:/usr/lib/mysql/plugin$ ls -l
total 1252
lrwxrwxrwx 1 root root 25 Jul 15 06:09 ha_innodb_plugin.so -> ha_innodb_plugin.so.0.0.0
lrwxrwxrwx 1 root root 25 Jul 15 06:09 ha_innodb_plugin.so.0 -> ha_innodb_plugin.so.0.0.0
-rw-r–r-- 1 root root 1276696 Nov 30 2010 ha_innodb_plugin.so.0.0.0

你可能感兴趣的:(运维部署调优)