译文 | MySQL 8.0 密码管理策略(一)

本文介绍了MySQL 8.0中增强的密码管理系统,包括密码重用策略和随机密码生成。密码重用策略防止用户在设定新密码时使用最近的密码历史,分为历史密码限制和间隔时间限制。随机密码功能允许MySQL为用户帐户自动生成安全的密码哈希,提供了一种无需手动设置密码的方式。
摘要由CSDN通过智能技术生成

作者: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 15:44:42.295778 | $A$005$=R:q'M(K
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值