All pages
Powered by GitBook
1 of 5

Loading...

Loading...

Loading...

Loading...

Loading...

Plugin Statements

Manage server plugins. This section covers INSTALL PLUGIN, UNINSTALL PLUGIN, and SHOW PLUGINS for extending server functionality.

INSTALL PLUGIN

Install a specific plugin from a shared library. This statement adds the plugin to the mysql.plugin table and loads its code into the server memory.

Syntax

Description

This statement installs an individual plugin from the specified library. To install the whole library (which could be required), use INSTALL SONAME. See also .

plugin_name is the name of the plugin as defined in theplugin declaration structure contained in the library file. Plugin names arenot case sensitive. For maximal compatibility, plugin names should be limitedto ASCII letters, digits, and underscore, because they are used in C sourcefiles, shell command lines, M4 and Bourne shell scripts, and SQL environments.

plugin_library is the name of the shared library thatcontains the plugin code. The file name extension can be omitted (which makes the statement look the same on all architectures).

The shared library must be located in the plugin directory (that is,the directory named by the system variable). The library must be in the plugin directory itself, not in a subdirectory. Bydefault, plugin_dir is plugin directory under the directory named bythe pkglibdir configuration variable, but it can be changed by settingthe value of plugin_dir at server startup. For example, setits value in a my.cnf file:

If the value of is a relative path name, it istaken to be relative to the base directory (the value of the system variable).

INSTALL PLUGIN adds a line to the mysql.plugin table thatdescribes the plugin. This table contains the plugin name and library filename.

INSTALL PLUGIN causes the server to readoption (my.cnf) files just as during server startup. This enables the plugin topick up any relevant options from those files. It is possible to add pluginoptions to an option file even before loading a plugin (if the loose prefix isused). It is also possible to uninstall a plugin, edit my.cnf, and install theplugin again. Restarting the plugin this way enables it to the new optionvalues without a server restart.

INSTALL PLUGIN also loads and initializes the plugin code tomake the plugin available for use. A plugin is initialized by executing itsinitialization function, which handles any setup that the plugin must performbefore it can be used.

To use INSTALL PLUGIN, you must have the for the mysql.plugin table.

At server startup, the server loads and initializes any plugin that islisted in the mysql.plugin table. This means that a plugin is installedwith INSTALL PLUGIN only once, not every time the serverstarts. Plugin loading at startup does not occur if the server is started withthe --skip-grant-tables option.

When the server shuts down, it executes the de-initialization functionfor each plugin that is loaded so that the plugin has a chance toperform any final cleanup.

If you need to load plugins for a single server startup when the--skip-grant-tables option is given (which tells the servernot to read system tables), use the--plugin-load .

IF NOT EXISTS

When the IF NOT EXISTS clause is used, MariaDB will return a note instead of an error if the specified plugin already exists. See .

Examples

The extension can also be omitted:

See Also

This page is licensed: GPLv2, originally from

INSTALL SONAME

Load all plugins contained within a shared library file. This statement automatically discovers and installs every valid plugin found in the specified library.

Syntax

Description

This statement is a variant of . It installs all

UNINSTALL SONAME

Uninstall all plugins loaded from a specific library. This statement removes every plugin associated with the library file and unloads the library itself.

Syntax

Description

This statement is a variant of statement, that removes all belonging to a specified

INSTALL PLUGIN [IF NOT EXISTS] plugin_name SONAME 'plugin_library'
SHOW PLUGINS
  • INSTALL SONAME

  • UNINSTALL PLUGIN

  • UNINSTALL SONAME

  • Installing a Plugin
    plugin_dir
    plugin_dir
    basedir
    INSERT privilege
    mariadbd option
    SHOW WARNINGS
    List of Plugins
    Plugin Overview
    INFORMATION_SCHEMA.PLUGINS Table
    mariadb-plugin
    fill_help_tables.sql
    from a given
    plugin_library
    . See
    for details.

    plugin_library is the name of the shared library thatcontains the plugin code. The file name extension (forexample, libmyplugin.so or libmyplugin.dll) can be omitted (which makes the statement look the same on all architectures).

    The shared library must be located in the plugin directory (that is,the directory named by the plugin_dir system variable). The library must be in the plugin directory itself, not in a subdirectory. Bydefault, plugin_dir is plugin directory under the directory named bythe pkglibdir configuration variable, but it can be changed by settingthe value of plugin_dir at server startup. For example, setits value in a my.cnf file:

    If the value of plugin_dir is a relative path name, it istaken to be relative to the MySQL base directory (the value of the basedirsystem variable).

    INSTALL SONAME adds one or more lines to the mysql.plugin table thatdescribes the plugin. This table contains the plugin name and library filename.

    INSTALL SONAME causes the server to readoption (my.cnf) files just as during server startup. This enables the plugin topick up any relevant options from those files. It is possible to add pluginoptions to an option file even before loading a plugin (if the loose prefix isused). It is also possible to uninstall a plugin, edit my.cnf, and install theplugin again. Restarting the plugin this way enables it to the new optionvalues without a server restart.

    INSTALL SONAME also loads and initializes the plugin code tomake the plugin available for use. A plugin is initialized by executing itsinitialization function, which handles any setup that the plugin must performbefore it can be used.

    To use INSTALL SONAME, you must have the INSERT privilege for the mysql.plugin table.

    At server startup, the server loads and initializes any plugin that islisted in the mysql.plugin table. This means that a plugin is installedwith INSTALL SONAME only once, not every time the serverstarts. Plugin loading at startup does not occur if the server is started withthe --skip-grant-tables option.

    When the server shuts down, it executes the de-initialization functionfor each plugin that is loaded so that the plugin has a chance toperform any final cleanup.

    If you need to load plugins for a single server startup when the--skip-grant-tables option is given (which tells the servernot to read system tables), use the--plugin-load mariadbd option.

    If you need to install only one plugin from a library, use the INSTALL PLUGIN statement.

    Examples

    To load the LOCALES plugin and all of its information_schema tables with one statement, use

    This statement can be used instead of INSTALL PLUGIN even when the library contains only one plugin:

    See Also

    • List of Plugins

    • Plugin Overview

    • SHOW PLUGINS

    • INSTALL PLUGIN

    This page is licensed: CC BY-SA / Gnu FDL

    INSTALL PLUGIN
    plugins
    INSTALL PLUGIN
    plugin_library
    . See
    for details.

    plugin_library is the name of the shared library thatcontains the plugin code. The file name extension (forexample, libmyplugin.so or libmyplugin.dll) can be omitted (which makes the statement look the same on all architectures).

    To use UNINSTALL SONAME, you must have the DELETE privilege for the mysql.plugin table.

    IF EXISTS

    If the IF EXISTS clause is used, MariaDB will return a note instead of an error if the plugin library does not exist. See SHOW WARNINGS.

    Examples

    To uninstall the XtraDB plugin and all of its information_schema tables with one statement, use

    See Also

    • INSTALL SONAME

    • SHOW PLUGINS

    • INSTALL PLUGIN

    • UNINSTALL PLUGIN

    This page is licensed: CC BY-SA / Gnu FDL

    UNINSTALL PLUGIN
    plugins
    UNINSTALL PLUGIN
    [mariadbd]
    plugin_dir=/path/to/plugin/directory
    INSTALL PLUGIN sphinx SONAME 'ha_sphinx.so';
    INSTALL PLUGIN innodb SONAME 'ha_xtradb';
    INSTALL PLUGIN IF NOT EXISTS example SONAME 'ha_example';
    Query OK, 0 rows affected (0.104 sec)
    
    INSTALL PLUGIN IF NOT EXISTS example SONAME 'ha_example';
    Query OK, 0 rows affected, 1 warning (0.000 sec)
    
    SHOW WARNINGS;
    +-------+------+------------------------------------+
    | Level | Code | Message                            |
    +-------+------+------------------------------------+
    | Note  | 1968 | Plugin 'example' already installed |
    +-------+------+------------------------------------+
    INSTALL SONAME 'plugin_library'
    [mariadbd]
    plugin_dir=/path/to/plugin/directory
    INSTALL SONAME 'locales';
    INSTALL SONAME 'ha_sequence';
    UNINSTALL SONAME  [IF EXISTS] 'plugin_library'
    UNINSTALL SONAME 'ha_xtradb';
    UNINSTALL SONAME IF EXISTS 'ha_example';
    Query OK, 0 rows affected (0.099 sec)
    
    UNINSTALL SONAME IF EXISTS 'ha_example';
    Query OK, 0 rows affected, 1 warning (0.000 sec)
    
    SHOW WARNINGS;
    +-------+------+-------------------------------------+
    | Level | Code | Message                             |
    +-------+------+-------------------------------------+
    | Note  | 1305 | SONAME ha_example.so does not exist |
    +-------+------+-------------------------------------+
    UNINSTALL PLUGIN
    UNINSTALL SONAME
    SHOW PLUGINS
    INFORMATION_SCHEMA.PLUGINS Table
    mysql_plugin
    SHOW PLUGINS
    INFORMATION_SCHEMA.PLUGINS Table
    mysql_plugin
    List of Plugins

    UNINSTALL PLUGIN

    Remove a specific plugin from the server. This statement unloads the plugin code and deletes its entry from the mysql.plugin table to prevent reloading.

    Syntax

    Description

    This statement removes a single installed plugin. To uninstall the whole library which contains the plugin, use UNINSTALL SONAME. You cannot uninstall a plugin if any table that uses it is open.

    plugin_name must be the name of some plugin that is listedin the table. The server executes the plugin's deinitializationfunction and removes the row for the plugin from the mysql.plugintable, so that subsequent server restarts will not load and initializethe plugin. UNINSTALL PLUGIN does not remove the plugin'sshared library file.

    To use UNINSTALL PLUGIN, you must have the privilege for the table.

    IF EXISTS

    If the IF EXISTS clause is used, MariaDB will return a note instead of an error if the plugin does not exist. See .

    Examples

    See Also

    This page is licensed: GPLv2, originally from

    UNINSTALL PLUGIN [IF EXISTS] plugin_name
    mysql.plugin
    DELETE
    mysql.plugin
    SHOW WARNINGS
    Plugin Overview
    mysql_plugin
    INSTALL PLUGIN
    List of Plugins
    fill_help_tables.sql
    UNINSTALL PLUGIN example;
    UNINSTALL PLUGIN IF EXISTS example;
    Query OK, 0 rows affected (0.099 sec)
    
    UNINSTALL PLUGIN IF EXISTS example;
    Query OK, 0 rows affected, 1 warning (0.000 sec)
    
    SHOW WARNINGS;
    +-------+------+-------------------------------+
    | Level | Code | Message                       |
    +-------+------+-------------------------------+
    | Note  | 1305 | PLUGIN example does not exist |
    +-------+------+-------------------------------+