文档首页
MySQL 8.4 参考手册
8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

正文为中文,英文原文默认隐藏。点击任意中文段落即可展开 / 收起对应英文原文。

打开官方英文原文 ↗

译文由机器翻译生成,仅供理解参考;有疑问请以官方英文原文为准。

中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 100%

8.2.17 插件式认证8.2.17 Pluggable Authentication

当客户端连接到 MySQL 服务器时,服务器使用客户端提供的用户名和客户端主机来从mysql.user系统表中选择适当的账户行。然后,服务器对客户端进行认证,根据账户行确定哪个认证插件适用于客户端:When a client connects to the MySQL server, the server uses the user name provided by the client and the client host to select the appropriate account row from the mysql.user system table. The server then authenticates the client, determining from the account row which authentication plugin applies to the client:

  • 如果服务器找不到插件,将发生错误,并且连接尝试会被拒绝。If the server cannot find the plugin, an error occurs and the connection attempt is rejected.

  • 否则,服务器会调用该插件来验证用户身份,插件会向服务器返回一个状态,指示用户是否提供了正确的密码并被允许连接。Otherwise, the server invokes that plugin to authenticate the user, and the plugin returns a status to the server indicating whether the user provided the correct password and is permitted to connect.

可插拔身份验证提供了以下重要功能:Pluggable authentication enables these important capabilities:

  • 认证方法的选择。 可插拔认证使数据库管理员能够轻松选择和更改单个 MySQL 账户使用的认证方法。Choice of authentication methods.  Pluggable authentication makes it easy for DBAs to choose and change the authentication method used for individual MySQL accounts.

  • 外部认证。 可插拔认证使客户端能够使用适用于将凭据存储在 mysql.user 系统表之外的认证方法的凭据连接到 MySQL 服务器。例如,可以创建插件以使用外部认证方法,如 PAM、Windows 登录 ID、LDAP 或 Kerberos。External authentication.  Pluggable authentication makes it possible for clients to connect to the MySQL server with credentials appropriate for authentication methods that store credentials elsewhere than in the mysql.user system table. For example, plugins can be created to use external authentication methods such as PAM, Windows login IDs, LDAP, or Kerberos.

  • 代理用户: 如果允许用户连接,认证插件可以向服务器返回一个与连接用户名称不同的用户名,以表示连接用户是另一个用户(被代理用户)的代理。在连接持续期间,代理用户在访问控制方面被视为具有被代理用户的权限。实际上,一个用户扮演另一个用户。更多信息请参见 第 8.2.19 节,“代理用户”。Proxy users:  If a user is permitted to connect, an authentication plugin can return to the server a user name different from the name of the connecting user, to indicate that the connecting user is a proxy for another user (the proxied user). While the connection lasts, the proxy user is treated, for purposes of access control, as having the privileges of the proxied user. In effect, one user impersonates another. For more information, see Section 8.2.19, “Proxy Users”.

Note

如果您使用 --skip-grant-tables 选项启动服务器,即使加载了身份验证插件,它们也不会被使用,因为服务器不执行客户端身份验证,并允许任何客户端连接。由于这不安全,如果使用 --skip-grant-tables 选项启动服务器,它还会通过启用 skip_networking 来禁用远程连接。If you start the server with the --skip-grant-tables option, authentication plugins are not used even if loaded because the server performs no client authentication and permits any client to connect. Because this is insecure, if the server is started with the --skip-grant-tables option, it also disables remote connections by enabling skip_networking.

可用的认证插件Available Authentication Plugins

MySQL 8.4 提供这些身份验证插件:MySQL 8.4 provides these authentication plugins:

Note

有关当前可插拔身份验证使用的限制信息,包括哪些连接器支持哪些插件,请参阅可插拔身份验证的限制。For information about current restrictions on the use of pluggable authentication, including which connectors support which plugins, see Restrictions on Pluggable Authentication.

第三方连接器开发人员应阅读该部分,以确定连接器在多插件认证功能上可以利用的程度,以及为提高兼容性需要采取的步骤。Third-party connector developers should read that section to determine the extent to which a connector can take advantage of pluggable authentication capabilities and what steps to take to become more compliant.

如果您有兴趣编写自己的认证插件,请参见 编写认证插件。If you are interested in writing your own authentication plugins, see Writing Authentication Plugins.

默认认证插件The Default Authentication Plugin

CREATE USER 和 ALTER USER 语句具有用于指定账户如何进行认证的语法。某些形式的此语法并未明确指定认证插件(没有 IDENTIFIED WITH 子句)。例如:The CREATE USER and ALTER USER statements have syntax for specifying how an account authenticates. Some forms of this syntax do not explicitly name an authentication plugin (there is no IDENTIFIED WITH clause). For example:

CREATE USER 'jeffrey'@'localhost' IDENTIFIED BY 'password';

在这种情况下,服务器会将默认身份验证插件分配给账户。MySQL 8.4 支持多因素身份验证,并且最多支持三条条款来指定账户如何进行身份验证。确定未指定插件的身份验证方法的默认身份验证插件的规则是针对具体因素的:In such cases, the server assigns the default authentication plugin to the account. MySQL 8.4 supports multifactor authentication and up to three clauses that specify how an account authenticates. The rules that determine the default authentication plugin for authentication methods that name no plugin are factor-specific:

  • 因素 1:如果 authentication_policy 的第 1 个元素指定了一个身份验证插件,则该插件为默认插件。如果 authentication_policy 的第 1 个元素为 *,则 caching_sha2_password 为默认插件。Factor 1: If authentication_policy element 1 names an authentication plugin, that plugin is the default. If authentication_policy element 1 is *, caching_sha2_password is the default.

    根据上述规则,以下语句创建了一个双因素身份验证账户,其第一个因素的身份验证方法由 authentication_policy 决定,如下所示:Given the rules above, the following statement creates a two-factor authentication account, with the first factor authentication method determined by authentication_policy, as shown here:

    CREATE USER 'wei'@'localhost' IDENTIFIED BY 'password'
      AND IDENTIFIED WITH authentication_ldap_simple;
    

    以同样的方式,此示例创建了一个三因素认证账户:In the same way, this example creates a three-factor authentication account:

    CREATE USER 'mateo'@'localhost' IDENTIFIED BY 'password'
      AND IDENTIFIED WITH authentication_ldap_simple
      AND IDENTIFIED WITH authentication_fido;
    

    您可以使用 SHOW CREATE USER 来查看应用的身份验证方法。You can use SHOW CREATE USER to view the applied authentication methods.

  • 因素 2 或 3:如果相应的 authentication_policy 元素指定了一个身份验证插件,则该插件为默认插件。如果 authentication_policy 元素为 * 或为空,则没有默认值;在没有指定插件的情况下尝试为该因素定义帐户身份验证方法将导致错误,如以下示例所示:Factor 2 or 3: If the corresponding authentication_policy element names an authentication plugin, that plugin is the default. If the authentication_policy element is * or empty, there is no default; attempting to define an account authentication method for the factor without naming a plugin is an error, as in the following examples:

    mysql> CREATE USER 'sofia'@'localhost' IDENTIFIED WITH authentication_ldap_simple 
           AND IDENTIFIED BY 'abc';
    ERROR 1524 (HY000): Plugin '' is not loaded
    
    mysql> CREATE USER 'sofia'@'localhost' IDENTIFIED WITH authentication_ldap_simple 
           AND IDENTIFIED BY 'abc';
    ERROR 1524 (HY000): Plugin '*' is not loaded
    

身份验证插件使用Authentication Plugin Usage

本节提供有关安装和使用身份验证插件的一般说明。有关特定插件的说明,请参阅第 8.4.1 节,“身份验证插件”中描述该插件的部分。This section provides general instructions for installing and using authentication plugins. For instructions specific to a given plugin, see the section that describes that plugin under Section 8.4.1, “Authentication Plugins”.

一般来说,可插拔认证在服务器端和客户端使用一对对应的插件,因此您可以这样使用给定的认证方法:In general, pluggable authentication uses a pair of corresponding plugins on the server and client sides, so you use a given authentication method like this:

  • 如果需要,安装包含适当插件的插件库。在服务器主机上,安装包含服务器端插件的库,以便服务器可以使用它来验证客户端连接。同样,在每个客户端主机上,安装包含客户端插件的库以供客户端程序使用。内置的认证插件无需安装。If necessary, install the plugin library or libraries containing the appropriate plugins. On the server host, install the library containing the server-side plugin, so that the server can use it to authenticate client connections. Similarly, on each client host, install the library containing the client-side plugin for use by client programs. Authentication plugins that are built in need not be installed.

  • 对于您创建的每个 MySQL 帐户,请指定用于身份验证的适当服务器端插件。如果该帐户使用默认身份验证插件,则创建帐户的语句无需显式指定插件。服务器会分配默认的身份验证插件,如默认身份验证插件中所述。For each MySQL account that you create, specify the appropriate server-side plugin to use for authentication. If the account is to use the default authentication plugin, the account-creation statement need not specify the plugin explicitly. The server assigns the default authentication plugin, determined as described in The Default Authentication Plugin.

  • 当客户端连接时,服务器端插件会告诉客户端程序应使用哪个客户端插件进行身份验证。When a client connects, the server-side plugin tells the client program which client-side plugin to use for authentication.

如果一个账户使用的身份验证方法是服务器和客户端程序的默认方法,则服务器无需向客户端传达应使用哪个客户端插件,从而可以避免一次客户端/服务器协商的往返。In the case that an account uses an authentication method that is the default for both the server and the client program, the server need not communicate to the client which client-side plugin to use, and a round trip in client/server negotiation can be avoided.

对于标准的 MySQL 客户端,例如 mysql 和 mysqladmin,可以在命令行中指定 --default-auth=plugin_name 选项,作为程序期望使用哪种客户端插件的提示,尽管如果用户账户关联的服务器端插件需要不同的客户端插件,服务器端会覆盖此设置。For standard MySQL clients such as mysql and mysqladmin, the --default-auth=plugin_name option can be specified on the command line as a hint about which client-side plugin the program can expect to use, although the server overrides this if the server-side plugin associated with the user account requires a different client-side plugin.

如果客户端程序找不到客户端插件库文件,请指定 --plugin-dir=dir_name 选项以指示插件库目录的位置。If the client program does not find the client-side plugin library file, specify a --plugin-dir=dir_name option to indicate the plugin library directory location.

认证插件客户端/服务器兼容性Authentication Plugin Client/Server Compatibility

可插拔身份验证使 MySQL 账户在身份验证方法的选择上更具灵活性,但在某些情况下,由于客户端和服务器之间身份验证插件不兼容,客户端连接可能无法建立。Pluggable authentication enables flexibility in the choice of authentication methods for MySQL accounts, but in some cases client connections cannot be established due to authentication plugin incompatibility between the client and server.

成功的客户端连接到给定服务器上的特定账户的一般兼容性原则是,客户端和服务器都必须支持该账户所需的认证方法。由于认证方法是由认证插件实现的,因此客户端和服务器都必须支持该账户所需的认证插件。The general compatibility principle for a successful client connection to a given account on a given server is that the client and server both must support the authentication method required by the account. Because authentication methods are implemented by authentication plugins, the client and server both must support the authentication plugin required by the account.

身份验证插件的不兼容可能以各种方式出现。例如:Authentication plugin incompatibilities can arise in various ways. Examples:

  • 使用 MySQL 5.7 客户端(版本 5.7.22 或更低)连接到使用 caching_sha2_password 进行认证的 MySQL 8.4 服务器账户。这会失败,因为 5.7 客户端不识别该插件。(在 MySQL 5.7.23 中,这个问题得到了处理,当时在 MySQL 客户端库和客户端程序中添加了对 caching_sha2_password 的客户端支持。)Connect using a MySQL 5.7 client from 5.7.22 or lower to a MySQL 8.4 server account that authenticates with caching_sha2_password. This fails because the 5.7 client does not recognize the plugin. (This issue is addressed in MySQL 5.7 as of 5.7.23, when caching_sha2_password client-side support was added to the MySQL client library and client programs.)

  • 使用 MySQL 5.7 客户端连接到使用 mysql_old_password 进行认证的 5.7 之前的服务器账户。这会因为多种原因失败。首先,这种连接需要 --secure-auth=0,而该选项已不再受支持。即使该选项仍被支持,5.7 客户端也不识别该插件,因为它在 MySQL 5.7 中已被移除。Connect using a MySQL 5.7 client to a pre-5.7 server account that authenticates with mysql_old_password. This fails for multiple reasons. First, such a connection requires --secure-auth=0, which is no longer a supported option. Even were it supported, the 5.7 client does not recognize the plugin because it was removed in MySQL 5.7.

  • 使用来自社区版的 MySQL 5.7 客户端连接到使用企业版专有 LDAP 认证插件进行认证的 MySQL 5.7 企业版服务器账户。这会失败,因为社区版客户端无法访问企业版插件。Connect using a MySQL 5.7 client from a Community distribution to a MySQL 5.7 Enterprise server account that authenticates using one of the Enterprise-only LDAP authentication plugins. This fails because the Community client does not have access to the Enterprise plugin.

通常,当客户端和服务器来自相同 MySQL 发行版时,不会出现这些兼容性问题。当客户端和服务器来自不同 MySQL 系列时,可能会出现问题。这些问题是 MySQL 在引入新的认证插件或移除旧插件的开发过程中固有的。为了尽量减少潜在的兼容性问题,应定期及时升级服务器、客户端和连接器。In general, these compatibility issues do not arise when connections are made between a client and server from the same MySQL distribution. When connections are made between a client and server from different MySQL series, issues can arise. These issues are inherent in the development process when MySQL introduces new authentication plugins or removes old ones. To minimize the potential for incompatibilities, regularly upgrade the server, clients, and connectors on a timely basis.

身份验证插件连接器——编写注意事项Authentication Plugin Connector-Writing Considerations

存在各种 MySQL 客户端/服务器协议的实现。libmysqlclient C API 客户端库就是一种实现。一些 MySQL 连接器(通常是非 C 语言编写的)提供了它们自己的实现。然而,并非所有协议实现都以相同的方式处理插件身份验证。本节描述了协议实现者应考虑的一种身份验证问题。Various implementations of the MySQL client/server protocol exist. The libmysqlclient C API client library is one implementation. Some MySQL connectors (typically those not written in C) provide their own implementation. However, not all protocol implementations handle plugin authentication the same way. This section describes an authentication issue that protocol implementors should take into account.

在客户端/服务器协议中,服务器告诉连接的客户端它认为的默认认证插件。如果客户端使用的协议实现尝试加载默认插件,而该插件在客户端不存在,则加载操作会失败。如果默认插件并不是客户端尝试连接的账户实际上所需的插件,这就是一个不必要的失败。In the client/server protocol, the server tells connecting clients which authentication plugin it considers the default. If the protocol implementation used by the client tries to load the default plugin and that plugin does not exist on the client side, the load operation fails. This is an unnecessary failure if the default plugin is not the plugin actually required by the account to which the client is trying to connect.

如果客户端/服务器协议实现没有自己的默认认证插件概念,并且总是尝试加载服务器指定的默认插件,那么如果该插件不可用,就会出现错误。If a client/server protocol implementation does not have its own notion of default authentication plugin and always tries to load the default plugin specified by the server, it fails with an error if that plugin is not available.

为避免此问题,客户端使用的协议实现应有自己的默认插件,并应将其作为首选(或者,在无法加载服务器指定的默认插件时,备用使用此默认插件)。示例:To avoid this problem, the protocol implementation used by the client should have its own default plugin and should use it as its first choice (or, alternatively, fall back to this default in case of failure to load the default plugin specified by the server). Example:

  • 在 MySQL 5.7 中,libmysqlclient 默认使用 mysql_native_password 或通过 MYSQL_DEFAULT_AUTH 选项在 mysql_options() 中指定的插件。In MySQL 5.7, libmysqlclient uses as its default choice either mysql_native_password or the plugin specified through the MYSQL_DEFAULT_AUTH option for mysql_options().

  • 当 5.7 客户端尝试连接到 8.4 服务器时,服务器将 caching_sha2_password 指定为默认认证插件,但客户端仍然会根据 mysql_native_password 或通过 MYSQL_DEFAULT_AUTH 指定的内容发送凭证信息。When a 5.7 client tries to connect to an 8.4 server, the server specifies caching_sha2_password as its default authentication plugin, but the client still sends credential details per either mysql_native_password or whatever is specified through MYSQL_DEFAULT_AUTH.

  • 客户端唯一加载服务器指定的插件的情况是在换插件请求时,但在这种情况下,插件可以是任何插件,取决于用户账户。在这种情况下,客户端必须尝试加载该插件,如果该插件不可用,则错误不可避免。The only time the client loads the plugin specified by the server is for a change-plugin request, but in that case it can be any plugin depending on the user account. In this case, the client must try to load the plugin, and if that plugin is not available, an error is not optional.

可插拔身份验证的限制Restrictions on Pluggable Authentication

本节的第一部分描述了可插拔身份验证框架的一般适用性限制,该框架在第 8.2.17 节,“可插拔身份验证”中有描述。第二部分描述了第三方连接器开发人员如何确定连接器能够利用可插拔身份验证功能的程度,以及采取哪些步骤以提高合规性。The first part of this section describes general restrictions on the applicability of the pluggable authentication framework described at Section 8.2.17, “Pluggable Authentication”. The second part describes how third-party connector developers can determine the extent to which a connector can take advantage of pluggable authentication capabilities and what steps to take to become more compliant.

此处使用的术语“本地认证”是指针对存储在mysql.user系统表中的密码进行认证。这与较早版本的 MySQL 服务器提供的认证方法相同,在可插拔认证实现之前使用。“Windows 本地认证”是指使用已登录 Windows 的用户凭据进行认证,这由 Windows 本地认证插件(简称“Windows 插件”)实现。The term “native authentication” used here refers to authentication against passwords stored in the mysql.user system table. This is the same authentication method provided by older MySQL servers, before pluggable authentication was implemented. “Windows native authentication” refers to authentication using the credentials of a user who has already logged in to Windows, as implemented by the Windows Native Authentication plugin (“Windows plugin” for short).

可插入式认证的一般限制General Pluggable Authentication Restrictions
  • Connector/C : 使用此连接器的客户端只能通过使用本地认证的账户连接到服务器。Connector/C++: Clients that use this connector can connect to the server only through accounts that use native authentication.

    例外情况:如果连接器被构建为动态链接到 libmysqlclient(而非静态链接),并且如果安装了该版本,它会加载当前版本的 libmysqlclient,或者如果连接器从源代码重新编译以链接到当前的 libmysqlclient,则该连接器支持可插入式认证。Exception: A connector supports pluggable authentication if it was built to link to libmysqlclient dynamically (rather than statically) and it loads the current version of libmysqlclient if that version is installed, or if the connector is recompiled from source to link against the current libmysqlclient.

    有关编写连接器以处理来自服务器的默认服务器端身份验证插件信息的详细信息,请参阅 身份验证插件连接器编写考虑事项。For information about writing connectors to handle information from the server about the default server-side authentication plugin, see Authentication Plugin Connector-Writing Considerations.

  • Connector/NET: 使用 Connector/NET 的客户端可以通过使用本地身份验证或 Windows 本地身份验证的帐户连接到服务器。Connector/NET: Clients that use Connector/NET can connect to the server through accounts that use native authentication or Windows native authentication.

  • Connector/PHP: 使用此连接器的客户端仅能通过使用本地身份验证的帐户连接到服务器,当使用 PHP 的 MySQL 本地驱动程序(mysqlnd)编译时。Connector/PHP: Clients that use this connector can connect to the server only through accounts that use native authentication, when compiled using the MySQL native driver for PHP (mysqlnd).

  • Windows 本地认证: 通过使用 Windows 插件的账户连接需要进行 Windows 域设置。如果没有设置,则使用 NTLM 认证,并且只能进行本地连接;也就是说,客户端和服务器必须运行在同一台计算机上。Windows native authentication: Connecting through an account that uses the Windows plugin requires Windows Domain setup. Without it, NTLM authentication is used and then only local connections are possible; that is, the client and server must run on the same computer.

  • 代理用户: 代理用户支持在客户端能够通过使用实现代理用户功能的插件进行身份验证的账户连接时提供(即,能够返回与连接用户不同的用户名的插件)。例如,PAM 和 Windows 插件支持代理用户。mysql_native_password(已弃用)和 sha256_password(已弃用)身份验证插件默认不支持代理用户,但可以配置为支持;参见 代理用户映射服务器支持。Proxy users: Proxy user support is available to the extent that clients can connect through accounts authenticated with plugins that implement proxy user capability (that is, plugins that can return a user name different from that of the connecting user). For example, the PAM and Windows plugins support proxy users. The mysql_native_password (deprecated) and sha256_password (deprecated) authentication plugins do not support proxy users by default, but can be configured to do so; see Server Support for Proxy User Mapping.

  • 复制:副本不仅可以使用本地认证的复制用户账户进行复制,还可以在具备所需客户端插件的情况下,通过使用非本地认证的复制用户账户进行连接。如果插件已内置于libmysqlclient中,则默认可用。否则,插件必须安装在副本端,安装目录为副本的plugin_dir系统变量指定的目录。Replication: Replicas can not only employ replication user accounts using native authentication, but can also connect through replication user accounts that use nonnative authentication if the required client-side plugin is available. If the plugin is built into libmysqlclient, it is available by default. Otherwise, the plugin must be installed on the replica side in the directory named by the replica's plugin_dir system variable.

  • FEDERATED 表: FEDERATED 表只能通过远程服务器上使用本地认证的账户访问远程表。FEDERATED tables: A FEDERATED table can access the remote table only through accounts on the remote server that use native authentication.

可插拔认证与第三方连接器Pluggable Authentication and Third-Party Connectors

第三方连接器开发人员可以使用以下指南来确定连接器是否准备好利用可插拔身份验证功能,以及采取哪些步骤以提高合规性:Third-party connector developers can use the following guidelines to determine readiness of a connector to take advantage of pluggable authentication capabilities and what steps to take to become more compliant:

  • 一个未经过任何修改的现有连接器使用本地认证,并且使用该连接器的客户端只能通过使用本地认证的账户连接到服务器。但是,你应该针对服务器的最新版本测试该连接器,以验证这种连接仍然能够正常工作。An existing connector to which no changes have been made uses native authentication and clients that use the connector can connect to the server only through accounts that use native authentication. However, you should test the connector against a recent version of the server to verify that such connections still work without problem.

    例外情况:如果连接器动态(而非静态)链接到libmysqlclient,并且在安装了该版本时加载当前版本的libmysqlclient,那么它可能在不做任何修改的情况下可以与可插拔认证一起工作。Exception: A connector might work with pluggable authentication without any changes if it links to libmysqlclient dynamically (rather than statically) and it loads the current version of libmysqlclient if that version is installed.

  • 为了利用可插拔身份验证功能,基于libmysqlclient的连接器应重新链接到当前版本的libmysqlclient。这使连接器能够支持通过需要客户端插件的帐户连接,这些插件现在内置于libmysqlclient中(例如 PAM 身份验证所需的明文插件和 Windows 本机身份验证所需的 Windows 插件)。与当前libmysqlclient链接还使连接器能够访问安装在默认 MySQL 插件目录中的客户端插件(通常为本地服务器的plugin_dir系统变量默认值所指定的目录)。To take advantage of pluggable authentication capabilities, a connector that is libmysqlclient-based should be relinked against the current version of libmysqlclient. This enables the connector to support connections though accounts that require client-side plugins now built into libmysqlclient (such as the cleartext plugin needed for PAM authentication and the Windows plugin needed for Windows native authentication). Linking with a current libmysqlclient also enables the connector to access client-side plugins installed in the default MySQL plugin directory (typically the directory named by the default value of the local server's plugin_dir system variable).

    如果连接器动态地链接到libmysqlclient,必须确保在客户端主机上安装了更新版本的libmysqlclient,并且连接器在运行时加载它。If a connector links to libmysqlclient dynamically, it must be ensured that the newer version of libmysqlclient is installed on the client host and that the connector loads it at runtime.

  • 连接器支持给定身份验证方法的另一种方式是在客户端/服务器协议中直接实现它。Connector/NET 使用这种方法来提供对 Windows 本地身份验证的支持。Another way for a connector to support a given authentication method is to implement it directly in the client/server protocol. Connector/NET uses this approach to provide support for Windows native authentication.

  • 如果一个连接器能够从不同于默认插件目录的目录加载客户端插件,它必须实现某种方式让客户端用户指定该目录。这种方式的可能性包括命令行选项或环境变量,通过它连接器可以获取目录名称。标准的 MySQL 客户端程序,例如 mysql 和 mysqladmin 实现了一个 --plugin-dir 选项。另请参见 C API 客户端插件接口。If a connector should be able to load client-side plugins from a directory different from the default plugin directory, it must implement some means for client users to specify the directory. Possibilities for this include a command-line option or environment variable from which the connector can obtain the directory name. Standard MySQL client programs such as mysql and mysqladmin implement a --plugin-dir option. See also C API Client Plugin Interface.

  • 如本节前面所述,连接器对代理用户的支持取决于其支持的身份验证方法是否允许代理用户。Proxy user support by a connector depends, as described earlier in this section, on whether the authentication methods that it supports permit proxy users.