## Plugins Installed with the INSTALL PLUGIN Statement 

--plugin-load=x 

A plugin located in a plugin library file can be loaded at runtime with the INSTALL PLUGIN  statement. The statement also registers the plugin in the mysql.plugin  table to cause the server to load it on subsequent restarts. For this reason, INSTALL PLUGIN  requires the INSERT  privilege for the mysql.plugin  table. 

The plugin library file base name depends on your platform. Common suffixes are .so  for Unix and Unix- like systems, .dll  for Windows. 

Example: The --plugin-load-add  option installs a plugin at server startup. To install a plugin named myplugin  from a plugin library file named somepluglib.so , use these lines in a my.cnf  file: 

[mysqld] plugin-load-add=myplugin=somepluglib.so 

In this case, the plugin is not registered in mysql.plugin . Restarting the server without the --plugin- load-add  option causes the plugin not to be loaded at startup. 

Alternatively, the INSTALL PLUGIN  statement causes the server to load the plugin code from the library file at runtime: 

INSTALL PLUGIN myplugin SONAME ’somepluglib.so’; 

INSTALL PLUGIN  also causes “permanent”  plugin registration: The plugin is listed in the mysql.plugin table to ensure that the server loads it on subsequent restarts. 

Many plugins can be loaded either at server startup or at runtime. However, if a plugin is designed such that it must be loaded and initialized during server startup, attempts to load it at runtime using INSTALL PLUGIN  produce an error: 

mysql> INSTALL PLUGIN myplugin SONAME ’somepluglib.so’; ERROR 1721 (HY000): Plugin ’myplugin’ is marked as not dynamically installable. You have to stop the server to install it. 

In this case, you must use --plugin-load , --plugin-load-add , or --early-plugin-load . 

If a plugin is named both using a --plugin-load , --plugin-load-add , or --early-plugin-load option and (as a result of an earlier INSTALL PLUGIN  statement) in the mysql.plugin  table, the server starts but writes these messages to the error log: 

## Controlling Plugin Activation State 

[ERROR] Function ’ plugin_name ’ already exists [Warning] Couldn’t load plugin named ’ plugin_name ’ with soname ’ plugin_object_file ’. 

If the server knows about a plugin when it starts (for example, because the plugin is named using a --plugin-load-add  option or is registered in the mysql.plugin  table), the server loads and enables the plugin by default. It is possible to control activation state for such a plugin using a -- plugin_name [= activation_state ]  startup option, where plugin_name  is the name of the plugin to affect, such as innodb , csv , or validate_password . As with other options, dashes and underscores are interchangeable in option names. Also, activation state values are not case-sensitive. For example, -- my_plugin=ON  and --my-plugin=on  are equivalent. 

• -- plugin_name =OFF 

