A client-side authentication plugin is available that enables clients to send passwords to the server as cleartext, without hashing or encryption. This plugin is built into the MySQL client library.
The following table shows the plugin name.
Table 6.15 Plugin and Library Names for Cleartext Authentication
|Plugin or File||Plugin or File Name|
|Server-side plugin||None, see discussion|
|Library file||None (plugin is built in)|
Many client-side authentication plugins perform hashing or encryption of a password before the client sends it to the server. This enables clients to avoid sending passwords as cleartext.
Hashing or encryption cannot be done for authentication schemes
that require the server to receive the password as entered on
the client side. In such cases, the client-side
mysql_clear_password plugin is used, which
enables the client to send the password to the server as
cleartext. There is no corresponding server-side plugin. Rather,
mysql_clear_password can be used on the
client side in concert with any server-side plugin that needs a
cleartext password. (Examples are the PAM and simple LDAP
authentication plugins; see
Section 184.108.40.206, “PAM Pluggable Authentication”, and
Section 220.127.116.11, “LDAP Pluggable Authentication”.)
The following discussion provides usage information specific to cleartext pluggable authentication. For general information about pluggable authentication in MySQL, see Section 6.2.17, “Pluggable Authentication”.
Sending passwords as cleartext may be a security problem in some configurations. To avoid problems if there is any possibility that the password would be intercepted, clients should connect to MySQL Server using a method that protects the password. Possibilities include SSL (see Section 6.3, “Using Encrypted Connections”), IPsec, or a private network.
To make inadvertent use of the
mysql_clear_password plugin less likely,
MySQL clients must explicitly enable it. This can be done in
LIBMYSQL_ENABLE_CLEARTEXT_PLUGINenvironment variable to a value that begins with
y. This enables the plugin for all client connections.
mysql_options()C API function supports a
MYSQL_ENABLE_CLEARTEXT_PLUGINoption that enables the plugin on a per-connection basis. Also, any program that uses
libmysqlclientand reads option files can enable the plugin by including an
enable-cleartext-pluginoption in an option group read by the client library.