MySQL Variables old_passwords 数据库 参数变量解释及正确配置使用

本站中文解释

old_passwords是MySQL数据库服务器参数。它用于指定MySQL服务器使用何种方式来加强用户的密码安全性。如果把old_passwords参数设置为ON,MySQL 将使用4.0旧的原始(或被称为“不安全”)的加密算法;如果设置为OFF,MySQL将使用最新强化的加密算法。

要设置old_passwords参数,可以使用以下命令:

SET GLOBAL old_passwords = ON;

现在,old_passwords参数已被设置,MySQL服务器将开始使用4.0旧的原始(或”不安全”)的加密算法。

官方英文解释

old_passwords

Command-Line Format --old-passwords=value
Deprecated Yes
System Variable old_passwords
Scope Global, Session
Dynamic Yes
Type Enumeration
Default Value 0
Valid Values

0

2

Note

This system variable is deprecated in MySQL
5.7; expect it to be removed in a future
release of MySQL.

This variable controls the password hashing method used by the
PASSWORD() function. It also
influences password hashing performed by
CREATE USER and
GRANT statements that specify a
password using an IDENTIFIED BY clause.

The following table shows, for each password hashing method,
the permitted value of old_passwords and
which authentication plugins use the hashing method.

Password Hashing Method old_passwords Value Associated Authentication Plugin
MySQL 4.1 native hashing 0 mysql_native_password
SHA-256 hashing 2 sha256_password

If you set old_passwords=2,
follow the instructions for using the
sha256_password plugin at
Section 6.4.1.5, “SHA-256 Pluggable Authentication”.

The server sets the global
old_passwords value during
startup to be consistent with the password hashing method
required by the authentication plugin indicated by the
default_authentication_plugin
system variable.

When a client successfully connects to the server, the server
sets the session
old_passwords value
appropriately for the account authentication method. For
example, if the account uses the
sha256_password authentication plugin, the
server sets old_passwords=2.

For additional information about authentication plugins and
hashing formats, see
Section 6.2.13, “Pluggable Authentication”, and
Section 6.1.2.4, “Password Hashing in MySQL”.


数据运维技术 » MySQL Variables old_passwords 数据库 参数变量解释及正确配置使用