最新消息: 新版网站上线了!!!

Windows下MySQL如何安装InndoDB plugin

一、环境

1.系统:Windows7

2.已安装MySQL服务器版本

mysql> select @@version;

+------------------+

| @@version        |

+------------------+

| 5.1.51-community |

+------------------+

1 row in set (0.00 sec)

二、操作步骤

1.可用show engines或show plugins命令查看当前安装的引擎或插件情况。

2.查看一下当前mysql安装是否支持动态添加插件。

mysql> show global variables like 'have_%';

+-------------------------+----------+

| Variable_name           | Value    |

+-------------------------+----------+

| have_community_features | YES      |

| have_compress           | YES      |

| have_crypt              | NO       |

| 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)

注意:若have_dynamic_loading 选项的value是YES,则说明支持。如果是NO,则必须麻烦,因为have_dynamic_loading是只读变量。

3.确保服务器不在运行

mysql>set global innodb_fast_shutdown=0;

shell>mysqladmin shutdown

这样会在关闭前确保做好完整的缓存保存等工作。如果该库较大且繁忙,那么可能花费较长时间。

三、修改配置文件my.ini后重新启动MySQL

1.去掉之前innodb的所有配置,在my.ini进行如下配置后重启mysql

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

#*** INNODB Specific options ***

ignore-builtin-innodb

plugin-load=innodb=ha_innodb_plugin.dll

plugin-load=innodb_trx=ha_innodb_plugin.dll

plugin-load=innodb_locks=ha_innodb_plugin.dll

plugin-load=innodb_lock_waits=ha_innodb_plugin.dll

plugin-load=innodb_cmp=ha_innodb_plugin.dll

plugin-load=innodb_cmp_reset=ha_innodb_plugin.dll

plugin-load=innodb_cmpmem=ha_innodb_plugin.dll

plugin-load=innodb_cmpmem_reset=ha_innodb_plugin.dll

注意:对之前的配置项目,前面加上loose_后均变成innodb plugin的配置项目,如

loose_innodb_additional_mem_pool_size=12M
loose_innodb_flush_log_at_trx_commit=1
loose_innodb_log_buffer_size=6M
loose_innodb_buffer_pool_size=538M
loose_innodb_log_file_size=269M
loose_innodb_thread_concurrency=10

loose_innodb_file_per_table=1

2.重启mysql

进入MySQL实例执行以下命令

INSTALL PLUGIN INNODB SONAME 'ha_innodb_plugin.dll';

INSTALL PLUGIN INNODB_TRX SONAME 'ha_innodb_plugin.dll';

INSTALL PLUGIN INNODB_LOCKS SONAME 'ha_innodb_plugin.dll';

INSTALL PLUGIN INNODB_LOCK_WAITS SONAME 'ha_innodb_plugin.dll';

INSTALL PLUGIN INNODB_CMP SONAME 'ha_innodb_plugin.dll';

INSTALL PLUGIN INNODB_CMP_RESET SONAME 'ha_innodb_plugin.dll';

INSTALL PLUGIN INNODB_CMPMEM SONAME 'ha_innodb_plugin.dll';

INSTALL PLUGIN INNODB_CMPMEM_RESET SONAME 'ha_innodb_plugin.dll';

3.查看

查看版本

mysql>select @@innodb_version;

+------------------+

| @@innodb_version |

+------------------+

| 1.0.12           |

+------------------+

1 row in set (0.00 sec)

查看引擎

mysql>show engines;

查看插件

mysql>show plugins;

.....

转载请注明:谷谷点程序 » Windows下MySQL如何安装InndoDB plugin