The user_variables
plugin was first released in MariaDB 10.2.0
The user_variables
plugin creates the USER_VARIABLES
table in the INFORMATION_SCHEMA
database. This table contains information about user-defined variables.
In MariaDB 10.2.6 and later, the user_variables
plugin is statically linked into the server by default, so it does not need to be installed.
Although the plugin's shared library is distributed with MariaDB by default, the plugin is not actually installed by MariaDB by default prior to MariaDB 10.2.6. There are two methods that can be used to install the plugin with MariaDB.
The first method can be used to install the plugin without restarting the server. You can install the plugin dynamically by executing INSTALL SONAME
or INSTALL PLUGIN
. For example:
INSTALL SONAME 'user_variables';
The second method can be used to tell the server to load the plugin when it starts up. The plugin can be installed this way by providing the --plugin-load
or the --plugin-load-add
options. This can be specified as a command-line argument to mysqld
or it can be specified in a relevant server option group in an option file. For example:
[mariadb] ... plugin_load_add = user_variables
You can uninstall the plugin dynamically by executing UNINSTALL SONAME
or UNINSTALL PLUGIN
. For example:
UNINSTALL SONAME 'user_variables';
If you installed the plugin by providing the --plugin-load
or the --plugin-load-add
options in a relevant server option group in an option file, then those options should be removed to prevent the plugin from being loaded the next time the server is restarted.
SELECT * FROM information_schema.USER_VARIABLES ORDER BY VARIABLE_NAME; +---------------+----------------+---------------+--------------------+ | VARIABLE_NAME | VARIABLE_VALUE | VARIABLE_TYPE | CHARACTER_SET_NAME | +---------------+----------------+---------------+--------------------+ | var | 0 | INT | utf8 | | var2 | abc | VARCHAR | utf8 | +---------------+----------------+---------------+--------------------+
Version | Status | Introduced |
---|---|---|
1.0 | Stable | MariaDB 10.3.13 |
1.0 | Gamma | MariaDB 10.2.6 |
1.0 | Alpha | MariaDB 10.2.0 |
user_variables
OFF
- Disables the plugin without removing it from the mysql.plugins
table. ON
- Enables the plugin. If the plugin cannot be initialized, then the server will still continue starting up, but the plugin will be disabled. FORCE
- Enables the plugin. If the plugin cannot be initialized, then the server will fail to start with an error. FORCE_PLUS_PERMANENT
- Enables the plugin. If the plugin cannot be initialized, then the server will fail to start with an error. In addition, the plugin cannot be uninstalled with UNINSTALL SONAME
or UNINSTALL PLUGIN
while the server is running. --user-variables=value
enumerated
ON
OFF
, ON
, FORCE
, FORCE_PLUS_PERMANENT
© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/user-variables-plugin/