content_image/804443.jpg
Note 

In the name sha256_password , “sha256”  refers to the 256-bit digest length the plugin uses for encryption. In the name caching_sha2_password , “sha2” refers more generally to the SHA-2 class of encryption algorithms, of which 256-bit encryption is one instance. The latter name choice leaves room for future expansion of possible digest lengths without changing the plugin name. 

The following table shows the plugin names on the server and client sides. 

<img src='content_image/804443.jpg'>

The following sections provide installation and usage information specific to SHA-256 pluggable authentication: 

•Installing SHA-256 Pluggable Authentication 

•Using SHA-256 Pluggable Authentication 

For general information about pluggable authentication in MySQL, see Section 6.2.17, “Pluggable Authentication” . 

## Installing SHA-256 Pluggable Authentication 

The sha256_password  plugin exists in server and client forms: 

•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 . 

## Using SHA-256 Pluggable Authentication 

To set up an account that uses the sha256_password  plugin for SHA-256 password hashing, use the following statement, where password  is the desired account password: 

CREATE USER ’sha256user’@’localhost’ IDENTIFIED WITH sha256_password BY ’ password ’; 

The server assigns the sha256_password  plugin to the account and uses it to encrypt the password using SHA-256, storing those values in the plugin  and authentication_string  columns of the mysql.user  system table. 

The preceding instructions do not assume that sha256_password  is the default authentication plugin. If sha256_password  is the default authentication plugin, a simpler CREATE USER  syntax can be used. 

To start the server with the default authentication plugin set to sha256_password , put these lines in the server option file: 

[mysqld] default_authentication_plugin=sha256_password 

