6.4.1.1 Native Pluggable Authentication本机可插拔身份验证

MySQL includes a mysql_native_password plugin that implements native authentication; that is, authentication based on the password hashing method in use from before the introduction of pluggable authentication.MySQL包括一个实现本机身份验证的mysql_native_password插件;也就是说,基于密码哈希方法的身份验证从引入可插拔身份验证之前就开始使用。

The following table shows the plugin names on the server and client sides.下表显示了服务器端和客户端的插件名称。

Table 6.12 Plugin and Library Names for Native Password Authentication用于本机密码身份验证的插件和库名称

Plugin or File插件或文件Plugin or File Name插件或文件名
Server-side plugin服务器端插件mysql_native_password
Client-side plugin客户端插件mysql_native_password
Library file库文件None (plugins are built in)无(内置插件)

The following sections provide installation and usage information specific to native pluggable authentication:以下部分提供了特定于本机可插拔身份验证的安装和使用信息:

For general information about pluggable authentication in MySQL, see Section 6.2.17, “Pluggable Authentication”.有关MySQL中可插拔身份验证的一般信息,请参阅第6.2.17节,“可插拔身份认证”

Installing Native Pluggable Authentication安装本机可插拔身份验证

The mysql_native_password plugin exists in server and client forms:mysql_native_password插件存在于服务器和客户端表单中:

  • The server-side plugin is built into the server, need not be loaded explicitly, and cannot be disabled by unloading it.服务器端插件内置于服务器中,不需要显式加载,也不能通过卸载来禁用。

  • The client-side plugin is built into the libmysqlclient client library and is available to any program linked against libmysqlclient.客户端插件内置于libmysqlclient客户端库中,可供任何与libmysqlclient链接的程序使用。

Using Native Pluggable Authentication使用本机可插拔身份验证

MySQL client programs use mysql_native_password by default. MySQL客户端程序默认使用mysql_native_passwordThe --default-auth option can be used as a hint about which client-side plugin the program can expect to use:--default-auth选项可以用作程序可以使用哪个客户端插件的提示:

shell> mysql --default-auth=mysql_native_password ...