mysql动态引擎plugin,使用Innodb Plugin替换MySQL内置的Innodb存储引擎
发布日期:2021-06-24 14:00:41 浏览次数:2 分类:技术文章

本文共 4087 字,大约阅读时间需要 13 分钟。

To use InnoDB Plugin in MySQL 5.1, you must disable the built-in version of InnoDB that is also included and instruct the server to use InnoDB Plugin instead. To accomplish this, use the following lines in your my.cnf file:

[mysqld]

ignore-builtin-innodb

plugin-load=innodb=ha_innodb_plugin.so

For the plugin-load option, innodb is the name to associate with the plugin and ha_innodb_plugin.so is the name of the shared object library that contains the plugin code. The extension of .so applies for Unix (and similar) systems. For HP-UX on HPPA (11.11) or Windows, the extension should be .sl or .dll, respectively, rather than .so.

If the server has problems finding the plugin when it starts up, specify the pathname to the plugin directory. For example, if plugins are located in the lib/mysql/plugin directory under the MySQL installation directory and you have installed MySQL at /usr/local/mysql, use these lines in your my.cnf file:

[mysqld]

ignore-builtin-innodb

plugin-load=innodb=ha_innodb_plugin.so

plugin_dir=/usr/local/mysql/lib/mysql/plugin

The previous examples show how to activate the storage engine part of InnoDB Plugin, but the plugin also implements several InnoDB-related INFORMATION_SCHEMA tables. (For information about these tables, see InnoDB INFORMATION_SCHEMA tables.) To enable these tables, include additional name=library pairs in the value of the plugin-load option:

[mysqld]

ignore-builtin-innodb

plugin-load=innodb=ha_innodb_plugin.so

;innodb_trx=ha_innodb_plugin.so

;innodb_locks=ha_innodb_plugin.so

;innodb_lock_waits=ha_innodb_plugin.so

;innodb_cmp=ha_innodb_plugin.so

;innodb_cmp_reset=ha_innodb_plugin.so

;innodb_cmpmem=ha_innodb_plugin.so

;innodb_cmpmem_reset=ha_innodb_plugin.so

The plugin-load option value as shown here is formatted on multiple lines for display purposes but should be written in my.cnf using a single line without spaces in the option value. On Windows, substitute .dll for each instance of the .so extension.

After the server starts, verify that InnoDB Plugin has been loaded by using the SHOW PLUGINS statement. For example, if you have loaded the storage engine and the INFORMATION_SCHEMA tables, the output should include lines similar to these:

mysql> SHOW PLUGINS;

+---------------------+--------+--------------------+...

| Name | Status | Type |...

+---------------------+--------+--------------------+...

...

| InnoDB | ACTIVE | STORAGE ENGINE |...

| INNODB_TRX | ACTIVE | INFORMATION SCHEMA |...

| INNODB_LOCKS | ACTIVE | INFORMATION SCHEMA |...

| INNODB_LOCK_WAITS | ACTIVE | INFORMATION SCHEMA |...

| INNODB_CMP | ACTIVE | INFORMATION SCHEMA |...

| INNODB_CMP_RESET | ACTIVE | INFORMATION SCHEMA |...

| INNODB_CMPMEM | ACTIVE | INFORMATION SCHEMA |...

| INNODB_CMPMEM_RESET | ACTIVE | INFORMATION SCHEMA |...

+---------------------+--------+--------------------+...

An alternative to using the plugin-load option at server startup is to use the INSTALL PLUGIN statement at runtime. First start the server with the ignore-builtin-innodb option to disable the built-in version of InnoDB:

[mysqld]

ignore-builtin-innodb

Then issue an INSTALL PLUGIN statement for each plugin that you want to load:

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';

...

INSTALL PLUGIN need be issued only once for each plugin. Installed plugins will be loaded automatically on subsequent server restarts.

If you build MySQL from a source distribution, InnoDB Plugin is one of the storage engines that is built by default. Build MySQL the way you normally do; for example, by using the instructions at Section 2.11, “Installing MySQL from Source”. After the build completes, you should find the plugin shared object file under the storage/innodb_plugin directory, and make install should install it in the plugin directory. Configure MySQL to use InnoDB Plugin as described earlier for binary distributions.

If you use gcc, InnoDB Plugin cannot be compiled with gcc 3.x; you must use gcc 4.x instead.

转载地址:https://blog.csdn.net/weixin_33303537/article/details/116118937 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:基于matlab的三相整流,基于MATLAB的三相整流电路的仿真研究
下一篇:matlab算kappa系数,[转载]Kappa系数的计算及应用

发表评论

最新留言

初次前来,多多关照!
[***.217.46.12]2024年04月17日 20时07分06秒

关于作者

    喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!

推荐文章