
MysqlINSTALL PLUGIN InnoDB SONAME ‘ha_innodb.so’
plugin_name 是在plugin声明中定义的plugin的名称,plugin名字大小写敏感可以由系统设置。plugin_library 是共享库的名字,共享库在 plugin的目录下,可能是静态或者动态库,比如:libmyplugin.so or libmyplugin.dylib
共享库必须放在plugin目录下,目录是由plugin_dir系统变量中定义的,默认这个目录是由配置变量中的pkglibdir定义的,可以在服务器启动时候改变,比如可以在my.cnf中设置:
[mysqld]
plugin_dir=/path/to/plugin/directory
如果设置相对目录,目录是相对mysqlbase的系统变量。
INSTALL PLUGIN在mysql.plugin表中增加一行相关记录。同时INSTALL PLUGIN 会加载并初始化plugin。
(To use INSTALL PLUGIN, you must have the INSERT privilege for the mysql.plugin table. )
在服务器启动的时候,服务器会加载所有plugin中的 plugin,也就是仅仅需要运行一次 INSTALL PLUGIN ,如果启动时候--skip-grant-tables ,则不会加载plugin。
服务器关闭的时候,会关闭plugin.
2、卸载plugin
语法如下:UNINSTALL PLUGIN plugin_name
实例:MysqlUNINSTALL PLUGIN InnoDB
plugin_name 是在plugin声明中定义的plugin的名称,plugin名字大小写敏感可以由系统设置。
3、显示已安装plugin
SHOW PLUGIN 可以看到所有的安装的plugin
实例:MysqlSHOW PLUGIN
4、重新加载新的plugin共享库
如果重新编译了plugin共享库源码天空
,可以选择以下两种方法之一:
A、卸载后重新安装
1,可以用show engines 或者 show plugins命令查看当前安装的引擎或者插件情况。2,查看一下当前mysql安装是否支持动态添加插件。
注意,若have_dynamic_loading 选项的value是YES,则说明支持。如果是NO,则必须麻烦,因为have_dynamic_loading是只读变量。
3,添加插件
首先确认一下插件的dll或者so的所在目录,偶安装在windows环境,dll所在目录是:${MYSQLHOME}/lib/plugin/ha_innodb_plugin.dll。
执行如下命令:
mysql>install plugin innodb dllname 'ha_innodb_plugin.dll'
mysql>install plugin innodb_trx soname 'ha_innodb_plugin.dll'
mysql>install plugin innodb_locks soname 'ha_innodb_plugin.dll'
mysql>install plugin innodb_lock_waits soname 'ha_innodb_plugin.dll'
mysql>install plugin innodb_cmp soname 'ha_innodb_plugin.dll'
mysql>install plugin innodb_cmp_reset soname 'ha_innodb_plugin.dll'
mysql>install plugin innodb_cmpmem soname 'ha_innodb_plugin.dll'
mysql>install plugin innodb_cmpmem_reset soname 'ha_innodb_plugin.dll'
4,检测插件安装是否成功,可以执行:show plugins命令或者show engines
1、首先安装MySQL服务器,并启动MySQL服务。2、下载TableMySQL插件,将其解压缩到本地。
3、打开MySQL命令行,使用“INSTALL PLUGIN tablemysql SONAME ‘tablemysql.so’”命令安装该插件。
4、使用“SHOW PLUGINS”命令查看已安装的插件,如果TableMySQL插件显示为“ACTIVE”,那么说明安装成功。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)