MySQL Server uses a pluggable storage engine architecture that allows storage engines to be loaded into and unloaded from a running MySQL server.
Prior to MySQL 5.4.2, the pluggable storage engine architecture is supported on Unix platforms only and pluggable storage engines are not supported on Windows.
Plugging in a Storage Engine
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 ha_example
and the shared library is
named ha_example.so
, you load it with the
following statement:
mysql> INSTALL PLUGIN ha_example SONAME 'ha_example.so';
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.
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
To unplug a storage engine, use the
UNINSTALL PLUGIN
statement:
mysql> UNINSTALL PLUGIN ha_example;
If you unplug a storage engine that is needed by existing tables, those tables become inaccessible, but will still be present on disk (where applicable). Ensure that there are no tables using a storage engine before you unplug the storage engine.
User Comments
Would be nice to add a section on pointers to how to develop storage engines, how they share their work with the server, what functionality they have to implement, etc.
To use the example plugin the correct INSTALL syntax is:
INSTALL PLUGIN example SONAME 'ha_example.so';
Add your own comment.