作者:Sri Sakthivel
原文链接:https://www.percona.com/blog/enhanced-password-management-systems-in-mysql-8-part-1
MySQL 8.0 在密码管理方面有很多改善,本文将介绍以下两个特性。
- 密码重用策略
- 生成随机密码
| 1 密码重用策略
该策略简单说,就是设置新密码时,可以限制禁止使用曾经用过的密码。有以下两种策略:
- 历史密码 password_history
- 间隔时间 password_reuse_interval
1.1 历史密码
MySQL 官方手册描述:
If an account is restricted on the basis of number of password changes, a new password cannot be chosen from a specified number of the most recent passwords.
在实验环境中,创建用户并添加条件password history 2,历史密码中最近的两个不能被重新使用。
mysql> create user 'herc'@'localhost' identified by 'Percona@321' password history 2;
Query OK, 0 rows affected (0.02 sec)
mysql> select user, host, password_reuse_history from mysql.user where user='herc'\G
*************************** 1. row ***************************
user: herc
host: localhost
password_reuse_history: 2
1 row in set (0.00 sec)
MySQL 将在 mysql.password_history 表上记录密码更改的信息。
mysql> select * from mysql.password_history;
+-----------+------+----------------------------+------------------------------------------------------------------------+
| Host | User | Password_timestamp | Password |
+-----------+------+----------------------------+------------------------------------------------------------------------+
| localhost | herc | 2021-09-20

本文介绍了MySQL 8.0中增强的密码管理系统,包括密码重用策略和随机密码生成。密码重用策略防止用户在设定新密码时使用最近的密码历史,分为历史密码限制和间隔时间限制。随机密码功能允许MySQL为用户帐户自动生成安全的密码哈希,提供了一种无需手动设置密码的方式。
最低0.47元/天 解锁文章
1235

被折叠的 条评论
为什么被折叠?



