Home  >  Article  >  Database  >  mysql_plugin - Configure the MySQL server plug-in

mysql_plugin - Configure the MySQL server plug-in

WBOY
WBOYforward
2023-08-31 14:33:07647browse

mysql_plugin - 配置 MySQL 服务器插件

Let us understand the mysql_plugin utility used in MySQL -

The mysql_plugin utility allows the MySQL administrator to manage the plugins loaded by the MySQL server.

It provides an alternative to specifying the --plugin-load option manually at server startup, or at runtime with the help of the INSTALL PLUGIN and UNINSTALL PLUGIN statements.

Depending on whether mysql_plugin is called to enable or disable the plug-in, the utility inserts or deletes rows, respectively, in the mysql.plugin table used as the plug-in registry.

For normal server startup, the server automatically loads and enables the plug-ins listed in mysql.plugin.

p>

For additional control over plugin activation, the --plugin_name option can be used naming a specific plugin.

Each call to mysql_plugin reads a configuration file that helps determine how to configure the plug-ins contained in a single plug-in library file. To call mysql_plugin, you can use the following command -

mysql_plugin [options] plugin {ENABLE|DISABLE}

The "plugin" here refers to the name of the plug-in to be configured.

ENABLE or DISABLE are case-insensitive and are used to specify whether to enable or disable components of the plug-in. Plug-in library, named in the configuration file.

The order of plugins and ENABLE or DISABLE parameters does not matter.

Let us take an example to understand this -

To configure a component of a plugin library file named "myplugins.so" on Linux or "myplugins.dll" on Windows, A plugin value for myplugins must be specified.

Assume that this plug-in library contains three plug-ins, namely plugin1, plugin2, and plugin3. These three plug-ins need to be configured under the control of mysql_plugin.

According to convention, the suffix of the configuration file is .ini, and the same basic name is the name of the plug-in library, so the default configuration file name of the plug-in library is "myplugins.ini".

The configuration file content is as follows -

myplugins
plugin1
plugin2
plugin3

The first line in the myplugins.ini file is the name of the library file without any extension, such as .so or .dll.

The remaining lines are the names of components that need to be enabled or disabled.

Each value in the file should be on a separate line.

Lines whose first character is "#" are treated as comments and ignored.

To enable the plugins listed in the configuration file, the mysql_plugin mentioned below must be called -

shell> mysql_plugin myplugins ENABLE

To disable the plugin, DISABLE should be used instead of ENABLE.

If mysql_plugin cannot find the configuration file or plug-in library file, or mysql_plugin cannot start the MySQL server, an error will occur.

p>

mysql_plugin supports the options mentioned below. They can be specified on the command line or in the [mysqld] group of any option file.

--help, -?

It helps to display a help message and exit.

--basedir=dir_name, -b dir_name

refers to the server base directory.

--datadir=dir_name, -d dir_name

refers to the server data directory.

--my-print-defaults=file_name, -b file_name

refers to the path where the my_print_defaults program is located.

--mysqld=file_name, -b file_name

It refers to the path of the mysqld server.

--no-defaults, -p

It means that no values ​​should be read from the configuration file. This option enables administrators to skip reading default values ​​from the configuration file.

--plugin-dir=dir_name, -p dir_name

It is the server plug-in directory.

--verbose, -v

refers to verbose mode. It prints more information about the program's functionality. This option can be used multiple times to increase the amount of information.

--version,-V

Help displays version information and exits.

The above is the detailed content of mysql_plugin - Configure the MySQL server plug-in. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete