MySQL - 安裝InnoDB插件


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_%"

+-------------------------+----------+
| Variable_name           | Value    |
+-------------------------+----------+
| have_community_features | YES      |
| have_compress           | YES      |
| have_crypt              | YES      |
| have_csv                | YES      |
| have_dynamic_loading    | YES      |
| have_geometry           | YES      |
| have_innodb             | YES      |
| have_ndbcluster         | NO       |
| have_openssl            | DISABLED |
| have_partitioning       | YES      |
| have_query_cache        | YES      |
| have_rtree_keys         | YES      |
| have_ssl                | DISABLED |
| have_symlink            | YES      |
+-------------------------+----------+
14 rows in set (0.00 sec)

安裝插件

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

 

如何使用這些【information_schema】中的INNODB_TRX,INNODB_LOCKS, INNODB_LOCK_WAITS表?

???


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM