MySQL 服务器包含了一个基于组件的架构,用于扩展服务器功能。服务器和其他组件可以使用组件提供的服务。(在使用服务方面,服务器也是一个组件,等同于其他组件)。组件之间交互仅通过他们各自提供的服务。
MySQL 服务器包含了若干个组件来扩展服务器功能:
Components for configuring error logging.
A component for checking passwords.
A component that enables applications to add their own message events to the audit log.
当组件安装后,服务器组件提供了与该组件相关的系统变量和状态变量。引用与该组件相关的变量需要完全的格式:component_name.variable_name。
安装与卸载组件
INSTALL COMPONENT与UNINSTALL COMPONENT SQL语句可以用来加载和卸载组件,比如 :
INSTALL COMPONENT 'file://component_validate_password';
UNINSTALL COMPONENT 'file://component_validate_password';
注:安装组件相对于安装插件,由于不用考虑文件后缀名,在各个平台都是统一的。
获取服务器组件信息:
可以通过mysql.component表获取已加载的组件信息。