MySQL Variables disconnect_on_expired_password 数据库 参数变量解释及正确配置使用
本站中文解释
MySQL的disconnect_on_expired_password参数控制MySQL服务器是否在密码过期时断开连接。如果参数值等于1,则在密码过期时MySQL服务器将断开与该用户的连接,但此值默认为0,表示不会断开已过期密码的连接,而是允许管理员通过其他方式(如修改密码)继续使用这些账户。通过使用以下命令可以对此参数的值进行设置:
SET GLOBAL disconnect_on_expired_password = 1;
或者在my.cnf文件中添加:disconnect_on_expired_password = 1
官方英文解释
disconnect_on_expired_password
Command-Line Format | --disconnect-on-expired-password[={OFF|ON}] |
---|---|
System Variable | disconnect_on_expired_password |
Scope | Global |
Dynamic | No |
Type | Boolean |
Default Value | ON |
This variable controls how the server handles clients with
expired passwords:
-
If the client indicates that it can handle expired
passwords, the value of
disconnect_on_expired_password
is irrelevant. The server permits the client to connect
but puts it in sandbox mode. -
If the client does not indicate that it can handle expired
passwords, the server handles the client according to the
value of
disconnect_on_expired_password
:-
If
disconnect_on_expired_password
:
is enabled, the server disconnects the client. -
If
disconnect_on_expired_password
:
is disabled, the server permits the client to connect
but puts it in sandbox mode.
-
For more information about the interaction of client and
server settings relating to expired-password handling, see
Section 6.2.12, “Server Handling of Expired Passwords”.