
Installing a Plugin with Plugin Load Options
--------------------------------------------

A plugin can be installed with a mysqld option by providing either the
--plugin-load-add or the --plugin-load option.

If a plugin is installed with one of these options, then a record will not be
added to the mysql.plugins table for the plugin. This means that if the server
is restarted without the same option set, then the plugin will not
automatically be loaded.

Installing a Plugin with --plugin-load-add
------------------------------------------

You can install a plugin with the --plugin-load-add option by specifying the
option as a command-line argument to mysqld or by specifying the option in a
relevant server option group in an option file.

The --plugin-load-add option uses the following format:

* Plugins can be specified in the format name=library, where name is the
plugin name and library is the plugin library. This format installs a single
plugin from the given plugin library.
* Plugins can also be specified in the format library, where library is the
plugin library. This format installs all plugins from the given plugin library.
* Multiple plugins can be specified by separating them with semicolons.

For example, to install all plugins in the server_audit plugin library (which
is currently only the server_audit audit plugin) and also the ed25519
authentication plugin from the auth_ed25519 plugin library, you could set the
option to the following values on the command-line:

$ mysqld --user=mysql --plugin-load-add='server_audit'
--plugin-load-add='ed25519=auth_ed25519'

You could also set the option to the same values in an option file:

[mariadb]
...
plugin_load_add = server_audit
plugin_load_add = ed25519=auth_ed25519

Special care must be taken when specifying both the --plugin-load option and
the --plugin-load-add option together. The --plugin-load option resets the
plugin load list, and this can cause unexpected problems if you are not aware.
The --plugin-load-add option does not reset the plugin load list, so it is
much safer to use. See Specifying Multiple Plugin Load Options for more
information.

Installing a Plugin with --plugin-load
--------------------------------------

You can install a plugin with the --plugin-load option by specifying the
option as a command-line argument to mysqld or by specifying the option in a
relevant server option group in an option file.

The --plugin-load option uses the following format:

* Plugins can be specified in the format name=library, where name is the
plugin name and library is the plugin library. This format installs a single
plugin from the given plugin library.
* Plugins can also be specified in the format library, where library is the
plugin library. This format installs all plugins from the given plugin library.
* Multiple plugins can be specified by separating them with semicolons.

For example, to install all plugins in the server_audit plugin library (which
is currently only the server_audit audit plugin) and also the ed25519
authentication plugin from the auth_ed25519 plugin library, you could set the
option to the following values on the command-line:

$ mysqld --user=mysql --plugin-load='server_audit;ed25519=auth_ed25519'

You could also set the option to the same values in an option file:

[mariadb]
...
plugin_load = server_audit;ed25519=auth_ed25519

Special care must be taken when specifying the --plugin-load option multiple
times, or when specifying both the --plugin-load option and the
--plugin-load-add option together. The --plugin-load option resets the plugin
load list, and this can cause unexpected problems if you are not aware. The
--plugin-load-add option does not reset the plugin load list, so it is much
safer to use. See Specifying Multiple Plugin Load Options for more information.

Specifying Multiple Plugin Load Options
---------------------------------------

Special care must be taken when specifying the --plugin-load option multiple
times, or when specifying both the --plugin-load option and the
--plugin-load-add option. The --plugin-load option resets the plugin load
list, and this can cause unexpected problems if you are not aware. The
--plugin-load-add option does not reset the plugin load list, so it is much
safer to use.

This can have the following consequences:

* If the --plugin-load option is specified multiple times, then only the last
instance will have any effect. For example, in the following case, the first
instance of the option is reset:

[mariadb]
...
plugin_load = server_audit
plugin_load = ed25519=auth_ed25519

* If the --plugin-load option is specified after the --plugin-load-add option,
then it will also reset the changes made by that option. For example, in the
following case, the --plugin-load-add option does not do anything, because the
subsequent --plugin-load option resets the plugin load list:

[mariadb]
...
plugin_load_add = server_audit
plugin_load = ed25519=auth_ed25519

* In contrast, if the --plugin-load option is specified before the
--plugin-load-add option, then it will work fine, because the
--plugin-load-add option does not reset the plugin load list. For example, in
the following case, both plugins are properly loaded:

[mariadb]
...
plugin_load = server_audit
plugin_load_add = ed25519=auth_ed25519

Installing a Plugin with mysql_plugin
-------------------------------------
