一、密码管理
#新密码不能和前面三次的密码相同
password_history = 3 ;
#新密码不能和前面九十天内使用的密码相同
password_reuse_interval = 90 ;
# 默认为off;为on 时 修改密码需要用户提供当前密码 (开启后修改密码需要验证旧密码,root 用户不需要)
password_require_current = on ;
#查看密码管理策略
mysql> show variables like 'password%';
+--------------------------+-------+
| Variable_name | Value |
+--------------------------+-------+
| password_history | 0 |
| password_require_current | OFF |
| password_reuse_interval | 0 |
+--------------------------+-------+
3 rows in set (0.00 sec)
参数修改(建议)
## 找到mysql的配置文件 my.cnf,默认在 /etc/my.cnf
vi /etc/my.cnf
## 在最后增加一行, 保存退出
password_history=6