MySQL - INSTALL PLUGIN Statement



In addition to existing server components, you can create a new required component in the server using the plugin API supported by the server. Using this API, you can install additional softwares such as storage engines, full-text parser plugins, and server extensions.

MySQL INSTALL PLUGIN Statement

You can install a MySQL plugin in MySQL using the INSTALL PLUGIN Statement. TO execute this statement, you need INSERT privilege.

Syntax

Following is the syntax of the MySQL INSTALL PLUGIN statement −

INSTALL PLUGIN plugin_name SONAME 'shared_library_name'

Where, plugin_name is the name of the plugin you need to install and shared_library_name is the .dill file of the plugin.

Before executing it, make sure that the .dll file of the specified plugin is available in the directory path which is set as a value to the plugin_dir variable. You can verify the value of this variable as shown below −

show variables like 'plugin_dir';

Output

Following is the output of the above mysql query −

Variable_name Value
plugin_dir Path_of_the_plugin_directory\plugin\

Example

Following query installs the clone plugin in MySQL −

INSTALL PLUGIN clone SONAME 'mysql_clone.dll';

After installing the plugin, you can verify the its details as shown below −

SELECT * FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'clone%';

Output

The above query produces the following output −

PLUGIN_NAME PLUGIN_STATUS
clone ACTIVE

Example

Following query installs two more plugins in MySQL using the INSTALL PLUGIN statement −

Install plugin validate_password soname 'validate_password.dll';
Install plugin mysql_no_login soname 'mysql_no_login.dll';

If you verify the plugins list at the bottom of the list you can observe the newly installed plugins −

SHOW PLUGINS;

Output

The above mysql query genertes the output shown below −

Name Status Type Library License
..... ..... ..... ..... .....
..... ..... ..... ..... .....
..... ..... ..... ..... .....
mysqlx ACTIVE DAEMON NULL GPL
clone ACTIVE CLONE mysql_clone.dll GPL
validate_password ACTIVE VALIDATE PASSWORD validate_password.dll GPL
mysql_no_login ACTIVE AUTHENTICATION mysql_no_login.dll GPL
Advertisements