简体   繁体   中英

mysql user password algorithm

How to change the password algorithm to SHA2 for mysql user. Is there any configuration changes? I guess, currently the mysql password is stored in SHA1 format. Please assist. I am not talking about the SHA2 function but when the user enters the password when he creates the mysql user.

The MySQL docu states something like this:

CREATE USER 'jeffrey'@'localhost'
IDENTIFIED WITH sha256_password BY 'new_password'
PASSWORD EXPIRE INTERVAL 180 DAY;

Where the important part for you is

IDENTIFIED WITH sha256_password BY <YOURSTRONGPASSWORD>

UPDATE

As written in this post of the MySQL bugtracker, you must consider the following two aspects:

  • You have to be connected to your server via a TLS/SSL connection or an unencrypted connection that supports password exchange using an RSA key pair [1].
  • The MySQL server must be configured with SSL [2].

[1]: https://dev.mysql.com/doc/refman/5.6/en/sha256-pluggable-authentication.html

[2]: https://dev.mysql.com/doc/refman/5.6/en/encrypted-connections.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM