欢迎您来到,李雷博客 | PHP博客        登录  |  注册

MySQL参数解析 password_require_current

更新:2022-11-16 13:41:47
人气:920
来源:互联网转载
A+

password_require_current:

作用范围:Global

动态修改:Yes

取值范围:ON,OFF

默认值:OFF

来看下面的示例,password_require_current=ON设置下,修改密码没有指定旧密码,报错,使用replace子句指定旧密码,再次执行,成功。

mysql> alter user app@'%' identified by 'cC@12345678';

ERROR 3892 (HY000): Current password needs to be specified in the REPLACE clause in order to change it.

mysql> alter user app@'%' identified by 'cC@12345678' replace 'bB@12345678';

Query OK, 0 rows affected (0.01 sec)

除了使用参数password_require_current来控制全局的密码修改策略外,还可以在create user和alter user语句中,使用password require current子句单独控制某个用户的密码修改策略,如下所示:

create user app1@’%’ identified by ‘aA@12345678’ password require current;

create user app2@’%’ identified by ‘aA@12345678’ password require current optional;

create user app3@’%’ identified by ‘aA@12345678’ password require current default;

推荐的文章
# 发表我的评论
  /     /  
# 最近评论
暂时还没有评论,要不要说点什么?
  Ads by Google
  联系博主
Hello,本博客系统采用PHP和MySql开发,程序开发完全是因为个人爱好,是自己纯手写PHP源代码,未采用任何PHP框架!
QQ:858353007   微信号:lileihot123
网站地图
会员服务
关于我们
QQ:858353007
 
广告服务
加我微信
移动端访问
 
 
Copyright © 2014- 2025 www.mdaima.com All Rights Reserved.
李雷博客,专注PHP经验、PHP教程及PHP源代码开源下载分享的PHP博客!   ICP备案号:京ICP备10202169号-4