The server plugin implementation comprises several components.
SQL statements:
INSTALL PLUGINregisters a plugin in themysql.plugintable and loads the plugin code.UNINSTALL PLUGINunregisters a plugin from themysql.plugintable and unloads the plugin code.The
WITH PARSERclause for full-text index creation associates a full-text parser plugin with a givenFULLTEXTindex.SHOW PLUGINSdisplays information about server plugins.
Command-line options and system variables:
The
--plugin-loadoption enables plugins to be loaded at server startup time.The
plugin_dirsystem variable indicates the location of the directory where all plugins must be installed. The value of this variable can be specified at server startup with a--plugin_dir=option. mysql_config --plugindir displays the default plugin directory path name.dir_name
For additional information about plugin loading, see Installing and Uninstalling Plugins.
Plugin-related tables:
The
INFORMATION_SCHEMA.PLUGINStable contains plugin information.The
mysql.plugintable lists each plugin that was installed withINSTALL PLUGINand is required for plugin use. For new MySQL installations, this table is created during the installation process.
The client plugin implementation is simpler:
For the
mysql_options()C API function, theMYSQL_DEFAULT_AUTHandMYSQL_PLUGIN_DIRoptions enable client programs to load authentication plugins.There are C API functions that enable management of client plugins.
To examine how MySQL implements plugins, consult the following source files in a MySQL source distribution:
In the
include/mysqldirectory,plugin.hexposes the public plugin API. This file should be examined by anyone who wants to write a plugin library.plugin_files provide additional information that pertains to specific types of plugins.xxx.hclient_plugin.hcontains information specific to client plugins.In the
sqldirectory,sql_plugin.handsql_plugin.cccomprise the internal plugin implementation.sql_acl.ccis where the server uses authentication plugins. These files need not be consulted by plugin developers. They may be of interest for those who want to know more about how the server handles plugins.In the
sql-commondirectory,client_plugin.himplements the C API client plugin functions, andclient.cimplements client authentication support. These files need not be consulted by plugin developers. They may be of interest for those who want to know more about how the server handles plugins.