Panoramica sui Plugin

Stai visualizzando una vecchia versione di questo article. Visualizza la versione più recente.

I plugin sono componenti del server che migliorano MariaDB in qualche modo. Può trattardi di nuovi Storage Engine, pluginper migliorare il parsing full-text, o anche piccole migliorie, come un plugin per ottenere un timestamp come intero.

Visualizzare le informazioni sui plugin

Vi sono diversi modi per vedere quali plugin sono attualmente attivi. Si noti che vi è un gran numero di plugin built-in che sono attivi per default, e che non possono essere rimossi dal server.

L'istruzione SHOW PLUGINS elenca tutti i plugin attivi.

SHOW PLUGINS;
+----------------------------+----------+--------------------+---------+---------+
| Name                       | Status   | Type               | Library | License |
+----------------------------+----------+--------------------+---------+---------+
...
| mysql_native_password      | ACTIVE   | AUTHENTICATION     | NULL    | GPL     |
| mysql_old_password         | ACTIVE   | AUTHENTICATION     | NULL    | GPL     |
| MRG_MyISAM                 | ACTIVE   | STORAGE ENGINE     | NULL    | GPL     |
...
+----------------------------+----------+--------------------+---------+---------+

Plugins with the Library listed as NULL are built-in and cannot be uninstalled.

Informazioni più dettagliate si possono ottenere interrogando la tabella INFORMATION_SCHEMA.PLUGINS.

SELECT * FROM information_schema.PLUGINS\G
...
*************************** 6. row ***************************
           PLUGIN_NAME: CSV
        PLUGIN_VERSION: 1.0
         PLUGIN_STATUS: ACTIVE
           PLUGIN_TYPE: STORAGE ENGINE
   PLUGIN_TYPE_VERSION: 100003.0
        PLUGIN_LIBRARY: NULL
PLUGIN_LIBRARY_VERSION: NULL
         PLUGIN_AUTHOR: Brian Aker, MySQL AB
    PLUGIN_DESCRIPTION: CSV storage engine
        PLUGIN_LICENSE: GPL
           LOAD_OPTION: FORCE
       PLUGIN_MATURITY: Stable
   PLUGIN_AUTH_VERSION: 1.0
*************************** 7. row ***************************
           PLUGIN_NAME: MEMORY
        PLUGIN_VERSION: 1.0
         PLUGIN_STATUS: ACTIVE
           PLUGIN_TYPE: STORAGE ENGINE
   PLUGIN_TYPE_VERSION: 100003.0
        PLUGIN_LIBRARY: NULL
PLUGIN_LIBRARY_VERSION: NULL
         PLUGIN_AUTHOR: MySQL AB
    PLUGIN_DESCRIPTION: Hash based, stored in memory, useful for temporary tables
        PLUGIN_LICENSE: GPL
           LOAD_OPTION: FORCE
       PLUGIN_MATURITY: Stable
   PLUGIN_AUTH_VERSION: 1.0
...

Here, if the PLUGIN_LIBRARY is NULL, the plugin is built-in and cannot be uninstalled.

Finally, you can query the mysql.plugin table. This table only contains plugins that have been loaded with INSTALL PLUGIN or the mysql_plugin utility, not built-in plugins, or plugins loaded with the --plugin-load option. It also contains much less information, just the name and library.

SELECT * FROM mysql.plugin;
+------+------------+
| name | dl         |
+------+------------+
| PBXT | libpbxt.so |
+------+------------+

Installing plugins

Plugins can be installed in three ways:

The --plugin-load option takes a semicolon-separated list of plugins to load, where each plugin is identified as name=library, where name is the plugin name and library is the plugin library in the plugin directory, specified by the plugin_dir system variable.

--plugin-load does not add records to the mysql.plugins table, so if the server is restarted without the same --plugin-load options, those plugins not listed will not be loaded.

Plugins installed with INSTALL PLUGIN or mysql_plugin will automatically be loaded the next time the server starts, unless specifically uninstalled, or deactivated, as described below.

Controlling plugin activation

Plugins that are listed in the mysql.plugins table, or listed as a --plugin-load option, will by default be loaded. This behavior can be changed, with --plugin-name options.

OptionDescription
--plugin_name=OFFDisables the plugin without removing it from the mysql.plugins table.
--plugin_name[=ON]Enables the plugin. If the plugin cannot initialize, the server will run with the plugin disabled.
--plugin_name=FORCEEnables the plugin, but if plugin cannot initialize, the server will not start.
--plugin_name=FORCE_PLUS_PERMANENTEnables the plugin, but if plugin cannot initialize, the server will not start. In addition, the plugin cannot be uninstalled while the server is running. (MariaDB 5.5.7)

The plugin status is listed in the PLUGIN_STATUS field of the INFORMATION_SCHEMA.PLUGINS table.

Uninstalling plugins

Plugins that are found in the mysql.plugin table, that is those that were installed with INSTALL PLUGIN or mysql_plugin can be uninstalled in one of two ways:

Plugins that were enabled as a --plugin-load option do not need to be uninstalled. If --plugin-load is omitted the next time the server starts, or the plugin is not listed as one of the --plugin-load entries, the plugin will not be loaded.

Commenti

Sto caricando i commenti......
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.