MySQL 服务器使用可插拔存储引擎架构,这使得存储引擎可以在运行中的 MySQL 服务器中加载或卸载。MySQL Server uses a pluggable storage engine architecture that enables storage engines to be loaded into and unloaded from a running MySQL server.
插入存储引擎Plugging in a Storage Engine
在存储引擎可以使用之前,必须使用 INSTALL PLUGIN 语句将存储引擎插件共享库加载到 MySQL 中。例如,如果 EXAMPLE 引擎插件名为 example,共享库名为 ha_example.so,则可以使用以下语句加载它:Before a storage engine can be used, the storage engine plugin
shared library must be loaded into MySQL using the
INSTALL PLUGIN statement. For
example, if the EXAMPLE engine plugin is
named example and the shared library is named
ha_example.so, you load it with the
following statement:
INSTALL PLUGIN example SONAME 'ha_example.so';
要安装可插拔存储引擎,插件文件必须位于 MySQL 插件目录中,并且执行 INSTALL PLUGIN 语句的用户必须对 mysql.plugin 表具有 INSERT 权限。To install a pluggable storage engine, the plugin file must be
located in the MySQL plugin directory, and the user issuing the
INSTALL PLUGIN statement must
have INSERT privilege for the
mysql.plugin table.
共享库必须位于 MySQL 服务器插件目录中,其位置由 plugin_dir 系统变量指定。The shared library must be located in the MySQL server plugin
directory, the location of which is given by the
plugin_dir system variable.
卸载存储引擎Unplugging a Storage Engine
要卸载存储引擎,请使用 UNINSTALL PLUGIN 语句:To unplug a storage engine, use the
UNINSTALL PLUGIN statement:
UNINSTALL PLUGIN example;
如果卸载一个现有表需要的存储引擎,这些表将无法访问,但仍然存在于磁盘上(如适用)。在卸载存储引擎之前,请确保没有表使用该存储引擎。If you unplug a storage engine that is needed by existing tables, those tables become inaccessible, but are still present on disk (where applicable). Ensure that there are no tables using a storage engine before you unplug the storage engine.